Skip to content

Commit dd03d16

Browse files
committed
feat: remove cryptoswift and update cocoapods
1 parent 8a7eca4 commit dd03d16

File tree

8 files changed

+18
-32
lines changed

8 files changed

+18
-32
lines changed

Package.resolved

Lines changed: 8 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Package.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ let package = Package(
1515
targets: ["SingleFactorAuth"])
1616
],
1717
dependencies: [
18-
.package(url: "https://github.com/torusresearch/fetch-node-details-swift.git", from: "5.1.0"),
19-
.package(url: "https://github.com/torusresearch/torus-utils-swift.git", from: "8.0.0"),
18+
.package(url: "https://github.com/torusresearch/fetch-node-details-swift.git", from: "6.0.1"),
19+
.package(url: "https://github.com/torusresearch/torus-utils-swift.git", from: "8.1.0"),
2020
.package(url: "https://github.com/vapor/jwt-kit.git", from: "4.0.0"),
21-
.package(url: "https://github.com/Web3Auth/session-manager-swift.git", from: "3.1.0")
21+
.package(url: "https://github.com/Web3Auth/session-manager-swift.git", from: "4.0.2"),
2222
],
2323
targets: [
2424
.target(

SingleFactorAuth.podspec

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |spec|
22
spec.name = "SingleFactorAuth"
3-
spec.version = "3.0.0"
3+
spec.version = "4.0.0"
44
spec.ios.deployment_target = "14.0"
55
spec.summary = "Enable one key flow for Web3Auth"
66
spec.homepage = "https://github.com/Web3Auth/single-factor-auth-swift"
@@ -10,7 +10,8 @@ Pod::Spec.new do |spec|
1010
spec.module_name = "SingleFactorAuth"
1111
spec.source = { :git => "https://github.com/web3Auth/single-factor-auth-swift", :tag => spec.version }
1212
spec.source_files = "Sources/SingleFactorAuth/*.{swift,json}","Sources/SingleFactorAuth/**/*.{swift,json}"
13-
spec.dependency 'Torus-fetchNodeDetails', '~> 5.1.0'
14-
spec.dependency 'Torus-utils', '~> 6.1.0'
15-
spec.dependency 'TorusSessionManager', '~> 3.0.1'
13+
spec.dependency 'Torus-fetchNodeDetails', '~> 6.0.1'
14+
spec.dependency 'curvelib.swift', '~> 1.0.1'
15+
spec.dependency 'Torus-utils', '~> 8.1.0'
16+
spec.dependency 'TorusSessionManager', '~> 4.0.2'
1617
end

Sources/SingleFactorAuth/SingleFactorAuth.swift

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import BigInt
22
import Combine
3-
import CryptoSwift
43
import FetchNodeDetails
54
import Foundation
65
import SessionManager
76
import TorusUtils
7+
import curveSecp256k1
88

99
public class SingleFactorAuth {
1010
let nodeDetailManager: NodeDetailManager
@@ -16,8 +16,6 @@ public class SingleFactorAuth {
1616
nodeDetailManager = NodeDetailManager(network: singleFactorAuthArgs.getNetwork().network)
1717
torusUtils = TorusUtils(
1818
enableOneKey: true,
19-
signerHost: singleFactorAuthArgs.getSignerUrl()! + "/api/sign",
20-
allowHost: singleFactorAuthArgs.getSignerUrl()! + "/api/allow",
2119
network: singleFactorAuthArgs.getNetwork().network,
2220
clientId: singleFactorAuthArgs.getWeb3AuthClientId()
2321
)
@@ -65,7 +63,7 @@ public class SingleFactorAuth {
6563

6664
let verifierParams = VerifierParams(verifier_id: loginParams.verifierId)
6765

68-
let aggregateIdToken = aggregateIdTokenSeeds.joined(separator: "\u{001d}").bytes.sha3(.keccak256).toHexString() // drop 0x
66+
let aggregateIdToken = try curveSecp256k1.keccak256(data: Data(aggregateIdTokenSeeds.joined(separator: "\u{001d}").utf8)).toHexString()
6967

7068
retrieveSharesResponse = try await torusUtils.retrieveShares(
7169
endpoints: details.getTorusNodeEndpoints(),

Sources/SingleFactorAuth/SingleFactorAuthArgs.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import CommonSources
21
import FetchNodeDetails
32
import TorusUtils
43

Tests/SingleFactorAuthTests/AquaTest.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import BigInt
2-
import CommonSources
32
import JWTKit
43
import XCTest
54

Tests/SingleFactorAuthTests/CyanTest.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import BigInt
2-
import CommonSources
32
import JWTKit
43
import XCTest
54

Tests/SingleFactorAuthTests/SingleFactorAuthTests.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import BigInt
2-
import CommonSources
32
import JWTKit
43
import XCTest
54

0 commit comments

Comments
 (0)