File tree Expand file tree Collapse file tree 2 files changed +19
-2
lines changed
Sources/TIMEncryptedStorage Expand file tree Collapse file tree 2 files changed +19
-2
lines changed Original file line number Diff line number Diff line change 11import Foundation
2+ #if canImport(CryptoKit)
23import CryptoKit
4+ #endif
35
46extension TIMESCryptor . AES {
7+ #if canImport(CryptoKit)
58 @available ( iOS 13 , * )
69 struct GCM {
710 @available ( iOS 13 , * )
@@ -27,4 +30,20 @@ extension TIMESCryptor.AES {
2730 }
2831 }
2932 }
33+ #else
34+ // Dummy implementation. iOS 13 should always be able to import CryptoKit, but the archiving fails for Xcode 13+.
35+ // This way we can make the implementations available on compile time, to avoid build errors.
36+ @available ( iOS 13 , * )
37+ struct GCM {
38+ @available ( iOS 13 , * )
39+ static func encrypt( key: Data , data: Data ) throws -> Data {
40+ fatalError ( " Failed to import CryptoKit! " )
41+ }
42+
43+ @available ( iOS 13 , * )
44+ static func decrypt( key: Data , data: Data ) throws -> Data {
45+ fatalError ( " Failed to import CryptoKit! " )
46+ }
47+ }
48+ #endif
3049}
Original file line number Diff line number Diff line change 11import Foundation
2- import CommonCrypto
3- import CryptoKit
42
53extension TIMKeyModel {
64
You can’t perform that action at this time.
0 commit comments