From 19fd4c01b8ecb2e789e680cb6a23353524751dc4 Mon Sep 17 00:00:00 2001 From: Jacob Persson <7156+typfel@users.noreply.github.com> Date: Fri, 2 Jun 2023 11:18:25 +0200 Subject: [PATCH] feat: generate XCFramework when releasing for Swift (#330) --- .github/workflows/bindings.yml | 4 +- .github/workflows/publish-swift.yml | 27 +- .gitignore | 2 + crypto-ffi/Makefile.toml | 16 +- crypto-ffi/bindings/swift/Package.swift | 33 -- .../WireCoreCrypto/BuildSettings.xcconfig | 22 + .../WireCoreCrypto.xcodeproj/project.pbxproj | 369 +++++++++++++++++ .../contents.xcworkspacedata | 7 + .../xcshareddata/IDEWorkspaceChecks.plist | 8 + .../WireCoreCrypto/WireCoreCrypto.h | 29 ++ .../bindings/swift/build-xcframework.sh | 32 ++ .../bindings/swift/lib/core_cryptoFFI.h | 392 ------------------ .../bindings/swift/lib/module.modulemap | 7 - crypto-ffi/build.rs | 8 +- 14 files changed, 480 insertions(+), 476 deletions(-) delete mode 100644 crypto-ffi/bindings/swift/Package.swift create mode 100644 crypto-ffi/bindings/swift/WireCoreCrypto/BuildSettings.xcconfig create mode 100644 crypto-ffi/bindings/swift/WireCoreCrypto/WireCoreCrypto.xcodeproj/project.pbxproj create mode 100644 crypto-ffi/bindings/swift/WireCoreCrypto/WireCoreCrypto.xcodeproj/project.xcworkspace/contents.xcworkspacedata create mode 100644 crypto-ffi/bindings/swift/WireCoreCrypto/WireCoreCrypto.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist create mode 100644 crypto-ffi/bindings/swift/WireCoreCrypto/WireCoreCrypto/WireCoreCrypto.h create mode 100755 crypto-ffi/bindings/swift/build-xcframework.sh delete mode 100644 crypto-ffi/bindings/swift/lib/core_cryptoFFI.h delete mode 100644 crypto-ffi/bindings/swift/lib/module.modulemap diff --git a/.github/workflows/bindings.yml b/.github/workflows/bindings.yml index 89fc576ed7..c8f821f607 100644 --- a/.github/workflows/bindings.yml +++ b/.github/workflows/bindings.yml @@ -61,9 +61,7 @@ jobs: - uses: Swatinem/rust-cache@v2 - run: | cd crypto-ffi - cargo make create-swift-package - cd bindings/swift - swift build + cargo make ios check-wasm: runs-on: ubuntu-latest diff --git a/.github/workflows/publish-swift.yml b/.github/workflows/publish-swift.yml index b615f8ee22..7bf8cc9fd2 100644 --- a/.github/workflows/publish-swift.yml +++ b/.github/workflows/publish-swift.yml @@ -29,26 +29,11 @@ jobs: targets: "aarch64-apple-ios,x86_64-apple-ios,aarch64-apple-ios-sim" - name: Setup cargo-make uses: davidB/rust-cargo-make@v1 - - - name: Build and Publish Swift package - env: - GIT_SSH_COMMAND: "ssh -i /Users/runner/.ssh/id_rsa -o UserKnownHostsFile=/Users/runner/.ssh/known_hosts" + - name: Build xcframework run: | - export SEMANTIC_VERSION=$(echo $GITHUB_REF_NAME | sed 's/^v\(.*\)/\1/') - mkdir -p /Users/runner/.ssh - echo "${{ secrets.SSH_DEPLOY_KEY }}" > /Users/runner/.ssh/id_rsa - chmod 600 /Users/runner/.ssh/id_rsa cd crypto-ffi - ssh-keyscan -H github.com > /Users/runner/.ssh/known_hosts - cargo make create-swift-package - cd ../../ - git clone git@github.com:wireapp/core-crypto-swift.git - cd core-crypto-swift - git config --local user.email "github-actions[bot]@users.noreply.github.com" - git config --local user.name "github-actions[bot]" - cp -r ../core-crypto/crypto-ffi/bindings/swift/* ./ - git add . - git commit -m "chore: release of core-crypto $GITHUB_REF_NAME" - git tag $SEMANTIC_VERSION - git push origin main - git push origin $SEMANTIC_VERSION + cargo make create-ios-xcframework + - name: Upload xcframework + uses: softprops/action-gh-release@v1 + with: + files: crypto-ffi/bindings/swift/WireCoreCrypto.xcframework.zip \ No newline at end of file diff --git a/.gitignore b/.gitignore index f3c5a26b26..5964d4694f 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,8 @@ crypto-ffi/bindings/*/out crypto-ffi/bindings/*/.build crypto-ffi/bindings/*/build crypto-ffi/bindings/*/.swiftpm +**/WireCoreCrypto/CoreCrypto.swift +**/WireCoreCrypto/core_cryptoFFI.h DerivedData/ *.moved-aside *.pbxuser diff --git a/crypto-ffi/Makefile.toml b/crypto-ffi/Makefile.toml index 4cd730eae3..fc230f32af 100644 --- a/crypto-ffi/Makefile.toml +++ b/crypto-ffi/Makefile.toml @@ -137,26 +137,16 @@ args = ["build", "--target", "aarch64-apple-ios-sim", "--features", "mobile", "- condition = { platforms = ["mac"] } dependencies = ["ios-device", "ios-simulator-x86", "ios-simulator-arm"] -[tasks.ios-test-sim-build] +[tasks.ios-create-xcframework] condition = { platforms = ["mac"] } script = ''' cd bindings/swift - swift build -''' -dependencies = ["create-swift-package"] - -[tasks.create-swift-package] -condition = { platforms = ["mac"] } -script = ''' - cd bindings/swift - - lipo -create -output ./lib/libcore_crypto_ffi.a \ - ../../../target/x86_64-apple-ios/release/libcore_crypto_ffi.a \ - ../../../target/aarch64-apple-ios/release/libcore_crypto_ffi.a + ./create-xcframework.sh ''' dependencies = ["ios"] + ################################### Android ################################### [tasks.android-env] diff --git a/crypto-ffi/bindings/swift/Package.swift b/crypto-ffi/bindings/swift/Package.swift deleted file mode 100644 index 682fe3df2c..0000000000 --- a/crypto-ffi/bindings/swift/Package.swift +++ /dev/null @@ -1,33 +0,0 @@ -// swift-tools-version:5.5 - -import PackageDescription - -let package = Package( - name: "CoreCrypto", - platforms: [.iOS(.v12)], - products: [ - .library( - name: "CoreCrypto", - targets: ["CoreCrypto", "CoreCryptoSwift"] - ), - .library( - name: "LibCoreCrypto", - targets: ["LibCoreCrypto"] - ), - ], - dependencies: [], - targets: [ - .target( - name: "CoreCrypto", - dependencies: ["CoreCryptoSwift"] - ), - .systemLibrary( - name: "LibCoreCrypto", - path: "./lib" - ), - .target( - name: "CoreCryptoSwift", - dependencies: ["LibCoreCrypto"] - ), - ] -) diff --git a/crypto-ffi/bindings/swift/WireCoreCrypto/BuildSettings.xcconfig b/crypto-ffi/bindings/swift/WireCoreCrypto/BuildSettings.xcconfig new file mode 100644 index 0000000000..5ef6fe2cc9 --- /dev/null +++ b/crypto-ffi/bindings/swift/WireCoreCrypto/BuildSettings.xcconfig @@ -0,0 +1,22 @@ +// +// Wire +// Copyright (C) 2023 Wire Swiss GmbH +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see http://www.gnu.org/licenses/. +// + +// Configuration settings file format documentation can be found at: +// https://help.apple.com/xcode/#/dev745c5c974 + +CURRENT_PROJECT_VERSION = 11.0.0 diff --git a/crypto-ffi/bindings/swift/WireCoreCrypto/WireCoreCrypto.xcodeproj/project.pbxproj b/crypto-ffi/bindings/swift/WireCoreCrypto/WireCoreCrypto.xcodeproj/project.pbxproj new file mode 100644 index 0000000000..0f9d0f04b3 --- /dev/null +++ b/crypto-ffi/bindings/swift/WireCoreCrypto/WireCoreCrypto.xcodeproj/project.pbxproj @@ -0,0 +1,369 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 56; + objects = { + +/* Begin PBXBuildFile section */ + 16CDD1172A2636BB0073FB8E /* WireCoreCrypto.h in Headers */ = {isa = PBXBuildFile; fileRef = 16CDD1162A2636BB0073FB8E /* WireCoreCrypto.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 16CDD11F2A26392C0073FB8E /* core_cryptoFFI.h in Headers */ = {isa = PBXBuildFile; fileRef = 16CDD11D2A26392C0073FB8E /* core_cryptoFFI.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 16CDD1202A26392C0073FB8E /* CoreCrypto.swift in Sources */ = {isa = PBXBuildFile; fileRef = 16CDD11E2A26392C0073FB8E /* CoreCrypto.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 16CDD1132A2636BB0073FB8E /* WireCoreCrypto.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = WireCoreCrypto.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 16CDD1162A2636BB0073FB8E /* WireCoreCrypto.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WireCoreCrypto.h; sourceTree = ""; }; + 16CDD11D2A26392C0073FB8E /* core_cryptoFFI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = core_cryptoFFI.h; sourceTree = ""; }; + 16CDD11E2A26392C0073FB8E /* CoreCrypto.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CoreCrypto.swift; sourceTree = ""; }; + 16CDD1212A29E0760073FB8E /* BuildSettings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = BuildSettings.xcconfig; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 16CDD1102A2636BB0073FB8E /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 16CDD1092A2636BB0073FB8E = { + isa = PBXGroup; + children = ( + 16CDD1212A29E0760073FB8E /* BuildSettings.xcconfig */, + 16CDD1152A2636BB0073FB8E /* WireCoreCrypto */, + 16CDD1142A2636BB0073FB8E /* Products */, + ); + sourceTree = ""; + }; + 16CDD1142A2636BB0073FB8E /* Products */ = { + isa = PBXGroup; + children = ( + 16CDD1132A2636BB0073FB8E /* WireCoreCrypto.framework */, + ); + name = Products; + sourceTree = ""; + }; + 16CDD1152A2636BB0073FB8E /* WireCoreCrypto */ = { + isa = PBXGroup; + children = ( + 16CDD11D2A26392C0073FB8E /* core_cryptoFFI.h */, + 16CDD11E2A26392C0073FB8E /* CoreCrypto.swift */, + 16CDD1162A2636BB0073FB8E /* WireCoreCrypto.h */, + ); + path = WireCoreCrypto; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + 16CDD10E2A2636BB0073FB8E /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 16CDD11F2A26392C0073FB8E /* core_cryptoFFI.h in Headers */, + 16CDD1172A2636BB0073FB8E /* WireCoreCrypto.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + 16CDD1122A2636BB0073FB8E /* WireCoreCrypto */ = { + isa = PBXNativeTarget; + buildConfigurationList = 16CDD11A2A2636BB0073FB8E /* Build configuration list for PBXNativeTarget "WireCoreCrypto" */; + buildPhases = ( + 16CDD10E2A2636BB0073FB8E /* Headers */, + 16CDD10F2A2636BB0073FB8E /* Sources */, + 16CDD1102A2636BB0073FB8E /* Frameworks */, + 16CDD1112A2636BB0073FB8E /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = WireCoreCrypto; + productName = WireCoreCrypto; + productReference = 16CDD1132A2636BB0073FB8E /* WireCoreCrypto.framework */; + productType = "com.apple.product-type.framework"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 16CDD10A2A2636BB0073FB8E /* Project object */ = { + isa = PBXProject; + attributes = { + BuildIndependentTargetsInParallel = 1; + LastUpgradeCheck = 1420; + TargetAttributes = { + 16CDD1122A2636BB0073FB8E = { + CreatedOnToolsVersion = 14.2; + LastSwiftMigration = 1420; + }; + }; + }; + buildConfigurationList = 16CDD10D2A2636BB0073FB8E /* Build configuration list for PBXProject "WireCoreCrypto" */; + compatibilityVersion = "Xcode 14.0"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 16CDD1092A2636BB0073FB8E; + productRefGroup = 16CDD1142A2636BB0073FB8E /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 16CDD1122A2636BB0073FB8E /* WireCoreCrypto */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 16CDD1112A2636BB0073FB8E /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 16CDD10F2A2636BB0073FB8E /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 16CDD1202A26392C0073FB8E /* CoreCrypto.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + 16CDD1182A2636BB0073FB8E /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 16CDD1212A29E0760073FB8E /* BuildSettings.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + 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_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + 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; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + 16CDD1192A2636BB0073FB8E /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 16CDD1212A29E0760073FB8E /* BuildSettings.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + 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_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + 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; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; + 16CDD11B2A2636BB0073FB8E /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_KEY_NSHumanReadableCopyright = ""; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; + LD_RUNPATH_SEARCH_PATHS = ( + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = ( + "@executable_path/../Frameworks", + "@loader_path/Frameworks", + ); + MACOSX_DEPLOYMENT_TARGET = 13.1; + MARKETING_VERSION = 1.0; + "OTHER_LDFLAGS[sdk=iphoneos*][arch=arm64]" = "../../../../target/aarch64-apple-ios/release/libcore_crypto_ffi.a"; + "OTHER_LDFLAGS[sdk=iphonesimulator*][arch=arm64]" = "../../../../target/aarch64-apple-ios-sim/release/libcore_crypto_ffi.a"; + "OTHER_LDFLAGS[sdk=iphonesimulator*][arch=x86_64]" = "../../../../target/x86_64-apple-ios/release/libcore_crypto_ffi.a"; + PRODUCT_BUNDLE_IDENTIFIER = com.wire.WireCoreCrypto; + PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; + SDKROOT = auto; + SKIP_INSTALL = YES; + SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; + SUPPORTS_MACCATALYST = NO; + SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 16CDD11C2A2636BB0073FB8E /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_KEY_NSHumanReadableCopyright = ""; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; + LD_RUNPATH_SEARCH_PATHS = ( + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = ( + "@executable_path/../Frameworks", + "@loader_path/Frameworks", + ); + MACOSX_DEPLOYMENT_TARGET = 13.1; + MARKETING_VERSION = 1.0; + "OTHER_LDFLAGS[sdk=iphoneos*][arch=arm64]" = "../../../../target/aarch64-apple-ios/release/libcore_crypto_ffi.a"; + "OTHER_LDFLAGS[sdk=iphonesimulator*][arch=arm64]" = "../../../../target/aarch64-apple-ios-sim/release/libcore_crypto_ffi.a"; + "OTHER_LDFLAGS[sdk=iphonesimulator*][arch=x86_64]" = "../../../../target/x86_64-apple-ios/release/libcore_crypto_ffi.a"; + PRODUCT_BUNDLE_IDENTIFIER = com.wire.WireCoreCrypto; + PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; + SDKROOT = auto; + SKIP_INSTALL = YES; + SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; + SUPPORTS_MACCATALYST = NO; + SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 16CDD10D2A2636BB0073FB8E /* Build configuration list for PBXProject "WireCoreCrypto" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 16CDD1182A2636BB0073FB8E /* Debug */, + 16CDD1192A2636BB0073FB8E /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 16CDD11A2A2636BB0073FB8E /* Build configuration list for PBXNativeTarget "WireCoreCrypto" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 16CDD11B2A2636BB0073FB8E /* Debug */, + 16CDD11C2A2636BB0073FB8E /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 16CDD10A2A2636BB0073FB8E /* Project object */; +} diff --git a/crypto-ffi/bindings/swift/WireCoreCrypto/WireCoreCrypto.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/crypto-ffi/bindings/swift/WireCoreCrypto/WireCoreCrypto.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000000..919434a625 --- /dev/null +++ b/crypto-ffi/bindings/swift/WireCoreCrypto/WireCoreCrypto.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/crypto-ffi/bindings/swift/WireCoreCrypto/WireCoreCrypto.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/crypto-ffi/bindings/swift/WireCoreCrypto/WireCoreCrypto.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000000..18d981003d --- /dev/null +++ b/crypto-ffi/bindings/swift/WireCoreCrypto/WireCoreCrypto.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/crypto-ffi/bindings/swift/WireCoreCrypto/WireCoreCrypto/WireCoreCrypto.h b/crypto-ffi/bindings/swift/WireCoreCrypto/WireCoreCrypto/WireCoreCrypto.h new file mode 100644 index 0000000000..e5f116f472 --- /dev/null +++ b/crypto-ffi/bindings/swift/WireCoreCrypto/WireCoreCrypto/WireCoreCrypto.h @@ -0,0 +1,29 @@ +// +// Wire +// Copyright (C) 2023 Wire Swiss GmbH +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see http://www.gnu.org/licenses/. +// + +#import + +//! Project version number for WireCoreCrypto. +FOUNDATION_EXPORT double WireCoreCryptoVersionNumber; + +//! Project version string for WireCoreCrypto. +FOUNDATION_EXPORT const unsigned char WireCoreCryptoVersionString[]; + +#import + + diff --git a/crypto-ffi/bindings/swift/build-xcframework.sh b/crypto-ffi/bindings/swift/build-xcframework.sh new file mode 100755 index 0000000000..8951f86883 --- /dev/null +++ b/crypto-ffi/bindings/swift/build-xcframework.sh @@ -0,0 +1,32 @@ +#!/bin/sh + +xcodebuild archive \ + -project 'WireCoreCrypto/WireCoreCrypto.xcodeproj' \ + -scheme 'WireCoreCrypto' \ + -configuration Release \ + -archivePath 'WireCoreCrypto-ios.xcarchive' \ + -destination 'generic/platform=ios' \ + SKIP_INSTALL=NO \ + BUILD_LIBRARY_FOR_DISTRIBUTION=YES + +xcodebuild archive \ + -project 'WireCoreCrypto/WireCoreCrypto.xcodeproj' \ + -scheme 'WireCoreCrypto' \ + -configuration Release \ + -archivePath 'WireCoreCrypto-simulator.xcarchive' \ + -destination 'generic/platform=ios Simulator' \ + SKIP_INSTALL=NO \ + BUILD_LIBRARY_FOR_DISTRIBUTION=YES + +xcodebuild -create-xcframework \ + -archive 'WireCoreCrypto-ios.xcarchive' \ + -framework 'WireCoreCrypto.framework' \ + -archive 'WireCoreCrypto-simulator.xcarchive' \ + -framework 'WireCoreCrypto.framework' \ + -output 'WireCoreCrypto.xcframework' + +zip -r WireCoreCrypto.xcframework.zip WireCoreCrypto.xcframework + +rm -rf WireCoreCrypto.xcframework +rm -rf WireCoreCrypto-ios.xcarchive +rm -rf WireCoreCrypto-simulator.xcarchive diff --git a/crypto-ffi/bindings/swift/lib/core_cryptoFFI.h b/crypto-ffi/bindings/swift/lib/core_cryptoFFI.h deleted file mode 100644 index 1cad97b430..0000000000 --- a/crypto-ffi/bindings/swift/lib/core_cryptoFFI.h +++ /dev/null @@ -1,392 +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 -#include - -// 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, RustBuffer, RustBuffer *_Nonnull); - -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 - -void ffi_CoreCrypto_105c_CoreCrypto_object_free( - void*_Nonnull ptr, - RustCallStatus *_Nonnull out_status - ); -void*_Nonnull CoreCrypto_105c_CoreCrypto_new( - RustBuffer path,RustBuffer key,RustBuffer client_id,RustBuffer ciphersuites, - RustCallStatus *_Nonnull out_status - ); -void*_Nonnull CoreCrypto_105c_CoreCrypto_deferred_init( - RustBuffer path,RustBuffer key,RustBuffer ciphersuites, - RustCallStatus *_Nonnull out_status - ); -void CoreCrypto_105c_CoreCrypto_mls_init( - void*_Nonnull ptr,RustBuffer client_id,RustBuffer ciphersuites, - RustCallStatus *_Nonnull out_status - ); -RustBuffer CoreCrypto_105c_CoreCrypto_mls_generate_keypairs( - void*_Nonnull ptr,RustBuffer ciphersuites, - RustCallStatus *_Nonnull out_status - ); -void CoreCrypto_105c_CoreCrypto_mls_init_with_client_id( - void*_Nonnull ptr,RustBuffer client_id,RustBuffer signature_public_keys,RustBuffer ciphersuites, - RustCallStatus *_Nonnull out_status - ); -void CoreCrypto_105c_CoreCrypto_restore_from_disk( - void*_Nonnull ptr, - RustCallStatus *_Nonnull out_status - ); -void CoreCrypto_105c_CoreCrypto_set_callbacks( - void*_Nonnull ptr,uint64_t callbacks, - RustCallStatus *_Nonnull out_status - ); -RustBuffer CoreCrypto_105c_CoreCrypto_client_public_key( - void*_Nonnull ptr,uint16_t ciphersuite, - RustCallStatus *_Nonnull out_status - ); -RustBuffer CoreCrypto_105c_CoreCrypto_client_keypackages( - void*_Nonnull ptr,uint16_t ciphersuite,uint32_t amount_requested, - RustCallStatus *_Nonnull out_status - ); -uint64_t CoreCrypto_105c_CoreCrypto_client_valid_keypackages_count( - void*_Nonnull ptr,uint16_t ciphersuite, - RustCallStatus *_Nonnull out_status - ); -void CoreCrypto_105c_CoreCrypto_create_conversation( - void*_Nonnull ptr,RustBuffer conversation_id,RustBuffer creator_credential_type,RustBuffer config, - RustCallStatus *_Nonnull out_status - ); -uint64_t CoreCrypto_105c_CoreCrypto_conversation_epoch( - void*_Nonnull ptr,RustBuffer conversation_id, - RustCallStatus *_Nonnull out_status - ); -int8_t CoreCrypto_105c_CoreCrypto_conversation_exists( - void*_Nonnull ptr,RustBuffer conversation_id, - RustCallStatus *_Nonnull out_status - ); -RustBuffer CoreCrypto_105c_CoreCrypto_process_welcome_message( - void*_Nonnull ptr,RustBuffer welcome_message,RustBuffer custom_configuration, - RustCallStatus *_Nonnull out_status - ); -RustBuffer CoreCrypto_105c_CoreCrypto_add_clients_to_conversation( - void*_Nonnull ptr,RustBuffer conversation_id,RustBuffer clients, - RustCallStatus *_Nonnull out_status - ); -RustBuffer CoreCrypto_105c_CoreCrypto_remove_clients_from_conversation( - void*_Nonnull ptr,RustBuffer conversation_id,RustBuffer clients, - RustCallStatus *_Nonnull out_status - ); -void CoreCrypto_105c_CoreCrypto_mark_conversation_as_child_of( - void*_Nonnull ptr,RustBuffer child_id,RustBuffer parent_id, - RustCallStatus *_Nonnull out_status - ); -RustBuffer CoreCrypto_105c_CoreCrypto_update_keying_material( - void*_Nonnull ptr,RustBuffer conversation_id, - RustCallStatus *_Nonnull out_status - ); -RustBuffer CoreCrypto_105c_CoreCrypto_commit_pending_proposals( - void*_Nonnull ptr,RustBuffer conversation_id, - RustCallStatus *_Nonnull out_status - ); -void CoreCrypto_105c_CoreCrypto_wipe_conversation( - void*_Nonnull ptr,RustBuffer conversation_id, - RustCallStatus *_Nonnull out_status - ); -RustBuffer CoreCrypto_105c_CoreCrypto_decrypt_message( - void*_Nonnull ptr,RustBuffer conversation_id,RustBuffer payload, - RustCallStatus *_Nonnull out_status - ); -RustBuffer CoreCrypto_105c_CoreCrypto_encrypt_message( - void*_Nonnull ptr,RustBuffer conversation_id,RustBuffer message, - RustCallStatus *_Nonnull out_status - ); -RustBuffer CoreCrypto_105c_CoreCrypto_new_add_proposal( - void*_Nonnull ptr,RustBuffer conversation_id,RustBuffer key_package, - RustCallStatus *_Nonnull out_status - ); -RustBuffer CoreCrypto_105c_CoreCrypto_new_update_proposal( - void*_Nonnull ptr,RustBuffer conversation_id, - RustCallStatus *_Nonnull out_status - ); -RustBuffer CoreCrypto_105c_CoreCrypto_new_remove_proposal( - void*_Nonnull ptr,RustBuffer conversation_id,RustBuffer client_id, - RustCallStatus *_Nonnull out_status - ); -RustBuffer CoreCrypto_105c_CoreCrypto_new_external_add_proposal( - void*_Nonnull ptr,RustBuffer conversation_id,uint64_t epoch,uint16_t ciphersuite,RustBuffer credential_type, - RustCallStatus *_Nonnull out_status - ); -RustBuffer CoreCrypto_105c_CoreCrypto_new_external_remove_proposal( - void*_Nonnull ptr,RustBuffer conversation_id,uint64_t epoch,RustBuffer key_package_ref, - RustCallStatus *_Nonnull out_status - ); -RustBuffer CoreCrypto_105c_CoreCrypto_join_by_external_commit( - void*_Nonnull ptr,RustBuffer public_group_state,RustBuffer custom_configuration,RustBuffer credential_type, - RustCallStatus *_Nonnull out_status - ); -void CoreCrypto_105c_CoreCrypto_merge_pending_group_from_external_commit( - void*_Nonnull ptr,RustBuffer conversation_id, - RustCallStatus *_Nonnull out_status - ); -void CoreCrypto_105c_CoreCrypto_clear_pending_group_from_external_commit( - void*_Nonnull ptr,RustBuffer conversation_id, - RustCallStatus *_Nonnull out_status - ); -RustBuffer CoreCrypto_105c_CoreCrypto_export_group_state( - void*_Nonnull ptr,RustBuffer conversation_id, - RustCallStatus *_Nonnull out_status - ); -RustBuffer CoreCrypto_105c_CoreCrypto_export_secret_key( - void*_Nonnull ptr,RustBuffer conversation_id,uint32_t key_length, - RustCallStatus *_Nonnull out_status - ); -RustBuffer CoreCrypto_105c_CoreCrypto_get_client_ids( - void*_Nonnull ptr,RustBuffer conversation_id, - RustCallStatus *_Nonnull out_status - ); -RustBuffer CoreCrypto_105c_CoreCrypto_random_bytes( - void*_Nonnull ptr,uint32_t length, - RustCallStatus *_Nonnull out_status - ); -void CoreCrypto_105c_CoreCrypto_reseed_rng( - void*_Nonnull ptr,RustBuffer seed, - RustCallStatus *_Nonnull out_status - ); -void CoreCrypto_105c_CoreCrypto_commit_accepted( - void*_Nonnull ptr,RustBuffer conversation_id, - RustCallStatus *_Nonnull out_status - ); -void CoreCrypto_105c_CoreCrypto_clear_pending_proposal( - void*_Nonnull ptr,RustBuffer conversation_id,RustBuffer proposal_ref, - RustCallStatus *_Nonnull out_status - ); -void CoreCrypto_105c_CoreCrypto_clear_pending_commit( - void*_Nonnull ptr,RustBuffer conversation_id, - RustCallStatus *_Nonnull out_status - ); -void CoreCrypto_105c_CoreCrypto_proteus_init( - void*_Nonnull ptr, - RustCallStatus *_Nonnull out_status - ); -void CoreCrypto_105c_CoreCrypto_proteus_session_from_prekey( - void*_Nonnull ptr,RustBuffer session_id,RustBuffer prekey, - RustCallStatus *_Nonnull out_status - ); -RustBuffer CoreCrypto_105c_CoreCrypto_proteus_session_from_message( - void*_Nonnull ptr,RustBuffer session_id,RustBuffer envelope, - RustCallStatus *_Nonnull out_status - ); -void CoreCrypto_105c_CoreCrypto_proteus_session_save( - void*_Nonnull ptr,RustBuffer session_id, - RustCallStatus *_Nonnull out_status - ); -void CoreCrypto_105c_CoreCrypto_proteus_session_delete( - void*_Nonnull ptr,RustBuffer session_id, - RustCallStatus *_Nonnull out_status - ); -int8_t CoreCrypto_105c_CoreCrypto_proteus_session_exists( - void*_Nonnull ptr,RustBuffer session_id, - RustCallStatus *_Nonnull out_status - ); -RustBuffer CoreCrypto_105c_CoreCrypto_proteus_decrypt( - void*_Nonnull ptr,RustBuffer session_id,RustBuffer ciphertext, - RustCallStatus *_Nonnull out_status - ); -RustBuffer CoreCrypto_105c_CoreCrypto_proteus_encrypt( - void*_Nonnull ptr,RustBuffer session_id,RustBuffer plaintext, - RustCallStatus *_Nonnull out_status - ); -RustBuffer CoreCrypto_105c_CoreCrypto_proteus_encrypt_batched( - void*_Nonnull ptr,RustBuffer session_id,RustBuffer plaintext, - RustCallStatus *_Nonnull out_status - ); -RustBuffer CoreCrypto_105c_CoreCrypto_proteus_new_prekey( - void*_Nonnull ptr,uint16_t prekey_id, - RustCallStatus *_Nonnull out_status - ); -RustBuffer CoreCrypto_105c_CoreCrypto_proteus_new_prekey_auto( - void*_Nonnull ptr, - RustCallStatus *_Nonnull out_status - ); -RustBuffer CoreCrypto_105c_CoreCrypto_proteus_last_resort_prekey( - void*_Nonnull ptr, - RustCallStatus *_Nonnull out_status - ); -uint16_t CoreCrypto_105c_CoreCrypto_proteus_last_resort_prekey_id( - void*_Nonnull ptr, - RustCallStatus *_Nonnull out_status - ); -RustBuffer CoreCrypto_105c_CoreCrypto_proteus_fingerprint( - void*_Nonnull ptr, - RustCallStatus *_Nonnull out_status - ); -RustBuffer CoreCrypto_105c_CoreCrypto_proteus_fingerprint_local( - void*_Nonnull ptr,RustBuffer session_id, - RustCallStatus *_Nonnull out_status - ); -RustBuffer CoreCrypto_105c_CoreCrypto_proteus_fingerprint_remote( - void*_Nonnull ptr,RustBuffer session_id, - RustCallStatus *_Nonnull out_status - ); -RustBuffer CoreCrypto_105c_CoreCrypto_proteus_fingerprint_prekeybundle( - void*_Nonnull ptr,RustBuffer prekey, - RustCallStatus *_Nonnull out_status - ); -void CoreCrypto_105c_CoreCrypto_proteus_cryptobox_migrate( - void*_Nonnull ptr,RustBuffer path, - RustCallStatus *_Nonnull out_status - ); -uint32_t CoreCrypto_105c_CoreCrypto_proteus_last_error_code( - void*_Nonnull ptr, - RustCallStatus *_Nonnull out_status - ); -void*_Nonnull CoreCrypto_105c_CoreCrypto_e2ei_new_enrollment( - void*_Nonnull ptr,RustBuffer client_id,RustBuffer display_name,RustBuffer handle,uint32_t expiry_days,uint16_t ciphersuite, - RustCallStatus *_Nonnull out_status - ); -void CoreCrypto_105c_CoreCrypto_e2ei_mls_init( - void*_Nonnull ptr,void*_Nonnull enrollment,RustBuffer certificate_chain, - RustCallStatus *_Nonnull out_status - ); -RustBuffer CoreCrypto_105c_CoreCrypto_e2ei_enrollment_stash( - void*_Nonnull ptr,void*_Nonnull enrollment, - RustCallStatus *_Nonnull out_status - ); -void*_Nonnull CoreCrypto_105c_CoreCrypto_e2ei_enrollment_stash_pop( - void*_Nonnull ptr,RustBuffer handle, - RustCallStatus *_Nonnull out_status - ); -int8_t CoreCrypto_105c_CoreCrypto_e2ei_is_degraded( - void*_Nonnull ptr,RustBuffer conversation_id, - RustCallStatus *_Nonnull out_status - ); -void ffi_CoreCrypto_105c_WireE2eIdentity_object_free( - void*_Nonnull ptr, - RustCallStatus *_Nonnull out_status - ); -RustBuffer CoreCrypto_105c_WireE2eIdentity_directory_response( - void*_Nonnull ptr,RustBuffer directory, - RustCallStatus *_Nonnull out_status - ); -RustBuffer CoreCrypto_105c_WireE2eIdentity_new_account_request( - void*_Nonnull ptr,RustBuffer previous_nonce, - RustCallStatus *_Nonnull out_status - ); -void CoreCrypto_105c_WireE2eIdentity_new_account_response( - void*_Nonnull ptr,RustBuffer account, - RustCallStatus *_Nonnull out_status - ); -RustBuffer CoreCrypto_105c_WireE2eIdentity_new_order_request( - void*_Nonnull ptr,RustBuffer previous_nonce, - RustCallStatus *_Nonnull out_status - ); -RustBuffer CoreCrypto_105c_WireE2eIdentity_new_order_response( - void*_Nonnull ptr,RustBuffer order, - RustCallStatus *_Nonnull out_status - ); -RustBuffer CoreCrypto_105c_WireE2eIdentity_new_authz_request( - void*_Nonnull ptr,RustBuffer url,RustBuffer previous_nonce, - RustCallStatus *_Nonnull out_status - ); -RustBuffer CoreCrypto_105c_WireE2eIdentity_new_authz_response( - void*_Nonnull ptr,RustBuffer authz, - RustCallStatus *_Nonnull out_status - ); -RustBuffer CoreCrypto_105c_WireE2eIdentity_create_dpop_token( - void*_Nonnull ptr,uint32_t expiry_secs,RustBuffer backend_nonce, - RustCallStatus *_Nonnull out_status - ); -RustBuffer CoreCrypto_105c_WireE2eIdentity_new_dpop_challenge_request( - void*_Nonnull ptr,RustBuffer access_token,RustBuffer previous_nonce, - RustCallStatus *_Nonnull out_status - ); -RustBuffer CoreCrypto_105c_WireE2eIdentity_new_oidc_challenge_request( - void*_Nonnull ptr,RustBuffer id_token,RustBuffer previous_nonce, - RustCallStatus *_Nonnull out_status - ); -void CoreCrypto_105c_WireE2eIdentity_new_challenge_response( - void*_Nonnull ptr,RustBuffer challenge, - RustCallStatus *_Nonnull out_status - ); -RustBuffer CoreCrypto_105c_WireE2eIdentity_check_order_request( - void*_Nonnull ptr,RustBuffer order_url,RustBuffer previous_nonce, - RustCallStatus *_Nonnull out_status - ); -RustBuffer CoreCrypto_105c_WireE2eIdentity_check_order_response( - void*_Nonnull ptr,RustBuffer order, - RustCallStatus *_Nonnull out_status - ); -RustBuffer CoreCrypto_105c_WireE2eIdentity_finalize_request( - void*_Nonnull ptr,RustBuffer previous_nonce, - RustCallStatus *_Nonnull out_status - ); -RustBuffer CoreCrypto_105c_WireE2eIdentity_finalize_response( - void*_Nonnull ptr,RustBuffer finalize, - RustCallStatus *_Nonnull out_status - ); -RustBuffer CoreCrypto_105c_WireE2eIdentity_certificate_request( - void*_Nonnull ptr,RustBuffer previous_nonce, - RustCallStatus *_Nonnull out_status - ); -void ffi_CoreCrypto_105c_CoreCryptoCallbacks_init_callback( - ForeignCallback _Nonnull callback_stub, - RustCallStatus *_Nonnull out_status - ); -RustBuffer CoreCrypto_105c_version( - - RustCallStatus *_Nonnull out_status - ); -RustBuffer ffi_CoreCrypto_105c_rustbuffer_alloc( - int32_t size, - RustCallStatus *_Nonnull out_status - ); -RustBuffer ffi_CoreCrypto_105c_rustbuffer_from_bytes( - ForeignBytes bytes, - RustCallStatus *_Nonnull out_status - ); -void ffi_CoreCrypto_105c_rustbuffer_free( - RustBuffer buf, - RustCallStatus *_Nonnull out_status - ); -RustBuffer ffi_CoreCrypto_105c_rustbuffer_reserve( - RustBuffer buf,int32_t additional, - RustCallStatus *_Nonnull out_status - ); diff --git a/crypto-ffi/bindings/swift/lib/module.modulemap b/crypto-ffi/bindings/swift/lib/module.modulemap deleted file mode 100644 index f3214aed7c..0000000000 --- a/crypto-ffi/bindings/swift/lib/module.modulemap +++ /dev/null @@ -1,7 +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 LibCoreCrypto { - header "core_cryptoFFI.h" - link "./libcore_crypto_ffi" - export * -} diff --git a/crypto-ffi/build.rs b/crypto-ffi/build.rs index dcda78e224..f015676a67 100644 --- a/crypto-ffi/build.rs +++ b/crypto-ffi/build.rs @@ -41,17 +41,11 @@ fn main() { UDL_FILE.into(), None, vec!["swift"], - Some("./bindings/swift/lib/".into()), + Some("./bindings/swift/WireCoreCrypto/WireCoreCrypto".into()), None, false, ) .unwrap(); - - std::fs::rename( - "./bindings/swift/lib/CoreCrypto.swift", - "./bindings/swift/Sources/CoreCryptoSwift/CoreCryptoSwift.swift", - ) - .unwrap(); } else if #[cfg(target_family = "wasm")] { println!("cargo:rustc-cfg=wasm"); }