Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
Empty file removed .gitmodules
Empty file.
2 changes: 1 addition & 1 deletion BlueCryptor.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "BlueCryptor"
s.version = "2.0.1"
s.version = "2.0.3"
s.summary = "Swift cross-platform crypto library using CommonCrypto/libcrypto via Package Manager."
s.homepage = "https://github.com/Kitura/BlueCryptor"
s.license = { :type => "Apache License, Version 2.0" }
Expand Down
19 changes: 0 additions & 19 deletions Cryptor-iOS/Cryptor-iOS.h

This file was deleted.

24 changes: 0 additions & 24 deletions Cryptor-iOS/Info.plist

This file was deleted.

747 changes: 0 additions & 747 deletions Cryptor.xcodeproj/project.pbxproj

This file was deleted.

This file was deleted.

76 changes: 0 additions & 76 deletions Cryptor.xcodeproj/xcshareddata/xcschemes/Cryptor-iOS.xcscheme

This file was deleted.

95 changes: 0 additions & 95 deletions Cryptor.xcodeproj/xcshareddata/xcschemes/Cryptor.xcscheme

This file was deleted.

52 changes: 0 additions & 52 deletions Cryptor.xcodeproj/xcshareddata/xcschemes/CryptorTests.xcscheme

This file was deleted.

12 changes: 0 additions & 12 deletions Cryptor.xcodeproj/xcshareddata/xcschemes/xcschememanagement.plist

This file was deleted.

14 changes: 10 additions & 4 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,26 @@ var targetDependencies: [Target.Dependency] = []

let package = Package(
name: "Cryptor",
platforms: [
.macOS(.v10_11),
.iOS(.v10),
.tvOS(.v10),
.watchOS(.v2),
],
products: [
// Products define the executables and libraries produced by a package, and make them visible to other packages.
.library(
name: "Cryptor",
targets: ["Cryptor"]),
],
],
dependencies: dependencies,
targets: [
.target(
name: "Cryptor",
dependencies: targetDependencies,
exclude: ["Info.plist"]),
dependencies: targetDependencies),
.testTarget(
name: "CryptorTests",
dependencies: ["Cryptor"]),
]
],
swiftLanguageVersions: [.v5]
)
21 changes: 6 additions & 15 deletions Sources/Cryptor/Crypto.swift
Original file line number Diff line number Diff line change
Expand Up @@ -87,21 +87,12 @@ extension Data: CryptoDigest {

// This force unwrap may look scary but for CommonCrypto this cannot fail.
// The API allows for optionals to support the OpenSSL implementation which can.
#if swift(>=5.0)
return self.withUnsafeBytes() {

let result = (Digest(using: algorithm).update(from: $0.baseAddress!, byteCount: self.count)?.final())!
let data = type(of: self).init(bytes: result, count: result.count)
return data
}
#else
return self.withUnsafeBytes() { (buffer: UnsafePointer<UInt8>) -> Data in

let result = (Digest(using: algorithm).update(from: buffer, byteCount: self.count)?.final())!
let data = type(of: self).init(bytes: result, count: result.count)
return data
}
#endif
return self.withUnsafeBytes() {

let result = (Digest(using: algorithm).update(from: $0.baseAddress!, byteCount: self.count)?.final())!
let data = type(of: self).init(bytes: result, count: result.count)
return data
}
}
}

Expand Down
Loading