Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: update for cocoapods #28

Merged
merged 5 commits into from
Apr 24, 2024
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions License.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Copyright (c) 2020 Torus Labs Private Limited (https://tor.us)

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
15 changes: 7 additions & 8 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -11,15 +11,14 @@ let package = Package(
products: [
// Products define the executables and libraries a package produces, and make them visible to other packages.
.library(
name: "tkey-mpc-swift",
targets: ["tkey-mpc-swift"]),
name: "tkey",
targets: ["tkey"]),
],
dependencies: [
// Dependencies declare other packages that this package depends on.
// .package(url: /* package url */, from: "1.0.0"),
.package(name: "TorusUtils", url: "https://github.com/torusresearch/torus-utils-swift" , from: "8.0.0"),
.package(name: "TorusUtils", url: "https://github.com/torusresearch/torus-utils-swift" , from: "8.0.3"),
// dev dependencies only
.package(name:"CryptoSwift", url: "https://github.com/krzyzanowskim/CryptoSwift.git",from: "1.5.1"),
.package(name:"jwt-kit", url: "https://github.com/vapor/jwt-kit.git", from: "4.0.0"),
],
targets: [
@@ -28,18 +27,18 @@ let package = Package(
.binaryTarget(name: "libtkey",
path: "Sources/libtkey/libtkey.xcframework"
),
.target(name: "tkey",
.target(name: "lib",
dependencies: ["libtkey"],
path: "Sources/libtkey"
),
.target(
name: "tkey-mpc-swift",
dependencies: ["tkey", "TorusUtils"],
name: "tkey",
dependencies: ["lib", "TorusUtils"],
path: "Sources/ThresholdKey"
),
.testTarget(
name: "tkey-pkgTests",
dependencies: ["tkey-mpc-swift", "CryptoSwift", .product(name: "JWTKit", package: "jwt-kit")],
dependencies: ["tkey", .product(name: "JWTKit", package: "jwt-kit")],
path: "Tests/tkeypkgTests"
),
]
4 changes: 2 additions & 2 deletions Sources/ThresholdKey/Common/KeyPoint.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Foundation
#if canImport(tkey)
import tkey
#if canImport(lib)
import lib
#endif


4 changes: 2 additions & 2 deletions Sources/ThresholdKey/Common/NodeDetails.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Foundation
#if canImport(tkey)
import tkey
#if canImport(lib)
import lib
#endif

public final class NodeDetails {
4 changes: 2 additions & 2 deletions Sources/ThresholdKey/Common/PrivateKey.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Foundation
#if canImport(tkey)
import tkey
#if canImport(lib)
import lib
#endif

public final class PrivateKey {
4 changes: 2 additions & 2 deletions Sources/ThresholdKey/Common/ShareStore.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Foundation
#if canImport(tkey)
import tkey
#if canImport(lib)
import lib
#endif

public final class ShareStore {
4 changes: 2 additions & 2 deletions Sources/ThresholdKey/Common/TssOptions.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Foundation
#if canImport(tkey)
import tkey
#if canImport(lib)
import lib
#endif

public final class TssOptions {
4 changes: 2 additions & 2 deletions Sources/ThresholdKey/GenerateShareStoreResult.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Foundation
#if canImport(tkey)
import tkey
#if canImport(lib)
import lib
#endif

public final class GenerateShareStoreResult {
4 changes: 2 additions & 2 deletions Sources/ThresholdKey/KeyDetails.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Foundation
#if canImport(tkey)
import tkey
#if canImport(lib)
import lib
#endif

public final class KeyDetails {
4 changes: 2 additions & 2 deletions Sources/ThresholdKey/KeyPointArray.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Foundation

#if canImport(tkey)
import tkey
#if canImport(lib)
import lib
#endif

public class KeyPointArray {
4 changes: 2 additions & 2 deletions Sources/ThresholdKey/KeyReconstructionDetails.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Foundation
#if canImport(tkey)
import tkey
#if canImport(lib)
import lib
#endif

public final class KeyReconstructionDetails: Codable {
4 changes: 2 additions & 2 deletions Sources/ThresholdKey/LocalMetadataTransitions.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Foundation

#if canImport(tkey)
import tkey
#if canImport(lib)
import lib
#endif

public final class LocalMetadataTransitions {
4 changes: 2 additions & 2 deletions Sources/ThresholdKey/Metadata.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Foundation
#if canImport(tkey)
import tkey
#if canImport(lib)
import lib
#endif

public final class Metadata {
4 changes: 2 additions & 2 deletions Sources/ThresholdKey/Modules/PrivateKeysModule.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Foundation
#if canImport(tkey)
import tkey
#if canImport(lib)
import lib
#endif

public struct KeyData: Decodable {
4 changes: 2 additions & 2 deletions Sources/ThresholdKey/Modules/SecurityQuestionModule.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Foundation
#if canImport(tkey)
import tkey
#if canImport(lib)
import lib
#endif

public final class SecurityQuestionModule {
4 changes: 2 additions & 2 deletions Sources/ThresholdKey/Modules/SeedPhraseModule.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Foundation
#if canImport(tkey)
import tkey
#if canImport(lib)
import lib
#endif

public struct SeedPhrase: Codable {
4 changes: 2 additions & 2 deletions Sources/ThresholdKey/Modules/ShareSerializationModule.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Foundation
#if canImport(tkey)
import tkey
#if canImport(lib)
import lib
#endif

public final class ShareSerializationModule {
4 changes: 2 additions & 2 deletions Sources/ThresholdKey/Modules/ShareTransferModule.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Foundation
#if canImport(tkey)
import tkey
#if canImport(lib)
import lib
#endif

public final class ShareTransferModule {
5 changes: 2 additions & 3 deletions Sources/ThresholdKey/Modules/TssModule.swift
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import Foundation

import Foundation
#if canImport(tkey)
import tkey
#if canImport(lib)
import lib
#endif
import CommonSources
import FetchNodeDetails
import TorusUtils

4 changes: 2 additions & 2 deletions Sources/ThresholdKey/Polynomial.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Foundation
#if canImport(tkey)
import tkey
#if canImport(lib)
import lib
#endif

public final class Polynomial {
4 changes: 2 additions & 2 deletions Sources/ThresholdKey/PublicPolynomial.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Foundation
#if canImport(tkey)
import tkey
#if canImport(lib)
import lib
#endif

public final class PublicPolynomial {
4 changes: 2 additions & 2 deletions Sources/ThresholdKey/RssComm.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Foundation
#if canImport(tkey)
import tkey
#if canImport(lib)
import lib
#endif

public final class RssComm {
5 changes: 2 additions & 3 deletions Sources/ThresholdKey/ServiceProvider.swift
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import Foundation
import TorusUtils
#if canImport(tkey)
import tkey
#if canImport(lib)
import lib
#endif
import FetchNodeDetails
import CommonSources

public final class ServiceProvider {
private(set) var pointer: OpaquePointer?
4 changes: 2 additions & 2 deletions Sources/ThresholdKey/ShareMap.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Foundation
#if canImport(tkey)
import tkey
#if canImport(lib)
import lib
#endif

public final class ShareMap {
4 changes: 2 additions & 2 deletions Sources/ThresholdKey/ShareStoreArray.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Foundation

#if canImport(tkey)
import tkey
#if canImport(lib)
import lib
#endif

public class ShareStoreArray {
4 changes: 2 additions & 2 deletions Sources/ThresholdKey/ShareStoreMap.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Foundation
#if canImport(tkey)
import tkey
#if canImport(lib)
import lib
#endif

public final class ShareStoreMap {
4 changes: 2 additions & 2 deletions Sources/ThresholdKey/ShareStorePolyIdIndexMap.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Foundation
#if canImport(tkey)
import tkey
#if canImport(lib)
import lib
#endif

public final class ShareStorePolyIdIndexMap {
4 changes: 2 additions & 2 deletions Sources/ThresholdKey/ShareTransferStore.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Foundation
#if canImport(tkey)
import tkey
#if canImport(lib)
import lib
#endif

public final class ShareTransferStore {
4 changes: 2 additions & 2 deletions Sources/ThresholdKey/StorageLayer.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Foundation
#if canImport(tkey)
import tkey
#if canImport(lib)
import lib
#endif


6 changes: 3 additions & 3 deletions Sources/ThresholdKey/ThresholdKey.swift
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import Foundation
#if canImport(tkey)
import tkey
#if canImport(lib)
import lib
#endif
import CommonSources
import FetchNodeDetails
import TorusUtils

public class ThresholdKey {
4 changes: 2 additions & 2 deletions Sources/ThresholdKey/Version.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Foundation
#if canImport(tkey)
import tkey
#if canImport(lib)
import lib
#endif

/// Returns the library version.
3 changes: 1 addition & 2 deletions Tests/tkeypkgTests/IntegrationTests.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import CommonSources
import FetchNodeDetails
import Foundation
@testable import tkey_mpc_swift
@testable import tkey
import TorusUtils
import XCTest

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import XCTest
import Foundation
@testable import tkey_mpc_swift
@testable import tkey
import Foundation

final class tkey_pkgPrivateKeyModuleTests: XCTestCase {
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import XCTest
import Foundation
@testable import tkey_mpc_swift
@testable import tkey
import Foundation

final class tkey_pkgSecurityQuestionModuleTests: XCTestCase {
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import XCTest
import Foundation
@testable import tkey_mpc_swift
@testable import tkey
import Foundation

final class tkey_pkgSeedPhraseModuleTests: XCTestCase {
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import XCTest
import Foundation
@testable import tkey_mpc_swift
@testable import tkey
import Foundation

final class tkey_pkgShareSerializationModuleTests: XCTestCase {
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import XCTest
import Foundation
@testable import tkey_mpc_swift
@testable import tkey
import Foundation

final class tkey_pkgShareTransferModuleTests: XCTestCase {
4 changes: 2 additions & 2 deletions Tests/tkeypkgTests/tkey_base.swift
Original file line number Diff line number Diff line change
@@ -8,12 +8,12 @@
import Foundation
import XCTest
import Foundation
@testable import tkey_mpc_swift
@testable import tkey
import TorusUtils

class tkey_baseTests: XCTestCase {

var torus = TorusUtils.init(clientId: "CLIENT ID")
var torus = TorusUtils.init(network: .sapphire(.SAPPHIRE_DEVNET), clientId: "CLIENT ID")

override func setUp() async throws {
let postbox_key = try! PrivateKey.generate()
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import XCTest
import Foundation
@testable import tkey_mpc_swift
@testable import tkey
import Foundation

final class tkey_pkgGenerateShareStoreResultTests: XCTestCase {
2 changes: 1 addition & 1 deletion Tests/tkeypkgTests/tkey_pkgKeyDetailsTest.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import XCTest
import Foundation
@testable import tkey_mpc_swift
@testable import tkey
import Foundation

final class tkey_pkgKeyDetailsTests: XCTestCase {
2 changes: 1 addition & 1 deletion Tests/tkeypkgTests/tkey_pkgKeyPointArrayTests.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import XCTest
import Foundation
@testable import tkey_mpc_swift
@testable import tkey
import Foundation

final class tkey_pkgKeyPointArrayTests: XCTestCase {
2 changes: 1 addition & 1 deletion Tests/tkeypkgTests/tkey_pkgKeyPointTests.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import XCTest
import Foundation
@testable import tkey_mpc_swift
@testable import tkey
import Foundation

final class tkey_pkgKeyPointTests: XCTestCase {
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import XCTest
import Foundation
@testable import tkey_mpc_swift
@testable import tkey
import Foundation

final class tkey_pkgKeyReconstructionDetailsTests: XCTestCase {
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import XCTest
import Foundation
@testable import tkey_mpc_swift
@testable import tkey
import Foundation

final class tkey_pkgLocalMetadataTransitionsTests: XCTestCase {
2 changes: 1 addition & 1 deletion Tests/tkeypkgTests/tkey_pkgMetadataTests.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import XCTest
import Foundation
@testable import tkey_mpc_swift
@testable import tkey
import Foundation

final class tkey_pkgMetadataTests: XCTestCase {
2 changes: 1 addition & 1 deletion Tests/tkeypkgTests/tkey_pkgNodeDetailsTests.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import XCTest
import Foundation
@testable import tkey_mpc_swift
@testable import tkey
import Foundation

final class tkey_pkgNodeDetailsTests: XCTestCase {
2 changes: 1 addition & 1 deletion Tests/tkeypkgTests/tkey_pkgPolynomialTests.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import XCTest
import Foundation
@testable import tkey_mpc_swift
@testable import tkey
import Foundation

final class tkey_pkgPolynomialTests: XCTestCase {
2 changes: 1 addition & 1 deletion Tests/tkeypkgTests/tkey_pkgPrivateKeyTests.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import XCTest
import Foundation
@testable import tkey_mpc_swift
@testable import tkey
import Foundation

final class tkey_pkgPrivateKeyTests: XCTestCase {
2 changes: 1 addition & 1 deletion Tests/tkeypkgTests/tkey_pkgPublicPolynomialTests.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import XCTest
import Foundation
@testable import tkey_mpc_swift
@testable import tkey
import Foundation

final class tkey_pkgPublicPolynomialTests: XCTestCase {
2 changes: 1 addition & 1 deletion Tests/tkeypkgTests/tkey_pkgServiceProviderTests.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import XCTest
import Foundation
@testable import tkey_mpc_swift
@testable import tkey
import Foundation

final class tkey_pkgServiceProviderTests: XCTestCase {
2 changes: 1 addition & 1 deletion Tests/tkeypkgTests/tkey_pkgShareStoreArrayTests.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import XCTest
import Foundation
@testable import tkey_mpc_swift
@testable import tkey
import Foundation

final class tkey_pkgShareStoreArrayTests: XCTestCase {
2 changes: 1 addition & 1 deletion Tests/tkeypkgTests/tkey_pkgShareStoreMapTests.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import XCTest
import Foundation
@testable import tkey_mpc_swift
@testable import tkey
import Foundation

final class tkey_pkgShareStoreMapTests: XCTestCase {
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import XCTest
import Foundation
@testable import tkey_mpc_swift
@testable import tkey
import Foundation

final class tkey_pkgShareStorePolyIdIndexMapTests: XCTestCase {
2 changes: 1 addition & 1 deletion Tests/tkeypkgTests/tkey_pkgShareStoreTests.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import XCTest
import Foundation
@testable import tkey_mpc_swift
@testable import tkey
import Foundation

final class tkey_pkgShareStoreTests: XCTestCase {
2 changes: 1 addition & 1 deletion Tests/tkeypkgTests/tkey_pkgStorageLayerTests.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import XCTest
import Foundation
@testable import tkey_mpc_swift
@testable import tkey
import Foundation

final class tkey_pkgStorageLayerTests: XCTestCase {
2 changes: 1 addition & 1 deletion Tests/tkeypkgTests/tkey_pkgThresholdKeyTests.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import XCTest
import Foundation
@testable import tkey_mpc_swift
@testable import tkey

final class tkey_pkgThresholdKeyTests: XCTestCase {
func test_basic_threshold_key_reconstruct() async {
2 changes: 1 addition & 1 deletion Tests/tkeypkgTests/tkey_pkgTssOptionsTests.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import XCTest
import Foundation
@testable import tkey_mpc_swift
@testable import tkey
import Foundation

final class tkey_pkgTssOptionsTests: XCTestCase {
2 changes: 1 addition & 1 deletion Tests/tkeypkgTests/tkey_pkgVersionTests.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import XCTest
import Foundation
@testable import tkey_mpc_swift
@testable import tkey

final class tkey_pkgVersionTests: XCTestCase {
func test_library_version() {
15 changes: 15 additions & 0 deletions tkey-mpc-swift.podspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Pod::Spec.new do |spec|
spec.name = "tkey-mpc-swift"
spec.version = "3.0.0"
spec.platform = :ios, "14.0"
spec.summary = "SDK allows you to create threshold key setup natively with multiparty computation support"
spec.homepage = "https://web3auth.io/"
spec.license = { :type => 'BSD', :file => 'License.md' }
spec.swift_version = "5.3"
spec.author = { "Torus Labs" => "hello@tor.us" }
spec.module_name = "tkey"
spec.source = { :git => "https://github.com/tkey/tkey-mpc-swift.git", :tag => spec.version }
spec.vendored_framework = "Sources/libtkey/libtkey.xcframework"
spec.dependency 'TorusUtils', '~> 8.0.3'
spec.source_files = "Sources/**/*.{swift,c,h}"
end
14 changes: 0 additions & 14 deletions tkey-rust-ios.podspec

This file was deleted.