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

fix: Add tvOS and watchOS to available #17

Merged
merged 1 commit into from
Jun 27, 2019
Merged
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
2 changes: 1 addition & 1 deletion BlueECC.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "BlueECC"
s.version = "1.2.1"
s.version = "1.2.3"
s.summary = "Swift cross-platform ECC crypto library using CommonCrypto/libcrypto via Package Manager."
s.homepage = "https://github.com/IBM-Swift/BlueECC"
s.license = { :type => "Apache License, Version 2.0" }
Expand Down
2 changes: 1 addition & 1 deletion Sources/CryptorECC/ECDecryptable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import OpenSSL
#endif

/// Extensions for encrypting, decrypting or signing `Data` using the appropriate algorithm determined by the key's curve with the provided `ECPrivateKey` or `ECPublicKey`.
@available(macOS 10.13, iOS 11, *)
@available(macOS 10.13, iOS 11, watchOS 4.0, tvOS 11.0, *)
extension Data {

/// Decrypt the encrypted data using the provided `ECPrivateKey`.
Expand Down
6 changes: 3 additions & 3 deletions Sources/CryptorECC/ECEncryptable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ import OpenSSL
#endif

/// A protocol for encrypting an instance of some object to generate some encrypted data.
@available(macOS 10.13, iOS 11, *)
@available(macOS 10.13, iOS 11, watchOS 4.0, tvOS 11.0, *)
protocol ECEncryptable {
/// Encrypt the object using ECIES and produce some encrypted `Data`.
func encrypt(with: ECPublicKey) throws -> Data
}

/// Extensions for encrypting or signing a `String` by converting it to UTF8 Data, then using the appropriate algorithm determined by the key's curve with the provided `ECPrivateKey` or `ECPublicKey`.
@available(macOS 10.13, iOS 11, *)
@available(macOS 10.13, iOS 11, watchOS 4.0, tvOS 11.0, *)
extension String: ECEncryptable {

/// UTF8 encode the String to Data and encrypt it using the `ECPublicKey`.
Expand All @@ -44,7 +44,7 @@ extension String: ECEncryptable {
}

/// Extension for signing `Data` with an `ECPrivateKey` and the algorithm determined by the key's curve.
@available(macOS 10.13, iOS 11, *)
@available(macOS 10.13, iOS 11, watchOS 4.0, tvOS 11.0, *)
extension Data: ECEncryptable {

/// Encrypt the data using the `ECPublicKey`.
Expand Down
2 changes: 1 addition & 1 deletion Sources/CryptorECC/ECPrivateKey.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ import OpenSSL
let signature = "Hello world".sign(with: privateKey)
```
*/
@available(macOS 10.13, iOS 11, *)
@available(macOS 10.13, iOS 11, watchOS 4.0, tvOS 11.0, *)
public class ECPrivateKey {
/// A String description of the curve this key was generated from.
public let curveId: String
Expand Down
2 changes: 1 addition & 1 deletion Sources/CryptorECC/ECPublicKey.swift
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ import OpenSSL
let verified = signature.verify(plaintext: "Hello world", using: publicKey)
```
*/
@available(macOS 10.13, iOS 11, *)
@available(macOS 10.13, iOS 11, watchOS 4.0, tvOS 11.0, *)
public class ECPublicKey {
/// A String description of the curve this key was generated from.
public let curveId: String
Expand Down
6 changes: 3 additions & 3 deletions Sources/CryptorECC/ECSignable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ import OpenSSL
#endif

/// A protocol for signing an instance of some object to generate an `ECSignature`.
@available(macOS 10.13, iOS 11, *)
@available(macOS 10.13, iOS 11, watchOS 4.0, tvOS 11.0, *)
protocol ECSignable {
/// Sign the object using ECDSA and produce an `ECSignature`.
func sign(with: ECPrivateKey) throws -> ECSignature
}

@available(macOS 10.13, iOS 11, *)
@available(macOS 10.13, iOS 11, watchOS 4.0, tvOS 11.0, *)
extension String: ECSignable {
/// UTF8 encode the String to Data and sign it using the `ECPrivateKey`.
/// The Data is signed using ECDSA with either SHA256, SHA384 or SHA512, depending on the key's curve.
Expand All @@ -40,7 +40,7 @@ extension String: ECSignable {
}
}

@available(macOS 10.13, iOS 11, *)
@available(macOS 10.13, iOS 11, watchOS 4.0, tvOS 11.0, *)
extension Data: ECSignable {
/// Sign the plaintext data using the provided `ECPrivateKey`.
/// The Data is signed using ECDSA with either SHA256, SHA384 or SHA512, depending on the key's curve.
Expand Down
2 changes: 1 addition & 1 deletion Sources/CryptorECC/ECSignature.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import OpenSSL

/// The signature produced by applying an Elliptic Curve Digital Signature Algorithm to some Plaintext data.
/// It consists of two binary unsigned integers, `r` and `s`.
@available(macOS 10.13, iOS 11, *)
@available(macOS 10.13, iOS 11, watchOS 4.0, tvOS 11.0, *)
public struct ECSignature {

// MARK: Signature Values
Expand Down
2 changes: 1 addition & 1 deletion Sources/CryptorECC/EllipticCurve.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import Foundation
#endif

/// An extensible list of elliptic curves supported by this repository.
@available(macOS 10.13, iOS 11, *)
@available(macOS 10.13, iOS 11, watchOS 4.0, tvOS 11.0, *)
public struct EllipticCurve: Equatable, CustomStringConvertible {

private let internalRepresentation: InternalRepresentation
Expand Down
2 changes: 1 addition & 1 deletion Tests/CryptorECCTests/CryptorECCTests.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import XCTest
@testable import CryptorECC

@available(macOS 10.13, iOS 11, *)
@available(macOS 10.13, iOS 11, watchOS 4.0, tvOS 11.0, *)
final class CryptorECCTests: XCTestCase {
static var allTests = [
("test_simpleCycle", test_simpleCycle),
Expand Down