diff --git a/.gitignore b/.gitignore index 5a3d528..b4582ea 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ prepate_command.txt CommonCrypto # Xcode # +Frameworks/ build/ *.pbxuser !default.pbxuser diff --git a/DemoPlayground.playground/contents.xcplayground b/DemoPlayground.playground/contents.xcplayground index f06e216..4937636 100644 --- a/DemoPlayground.playground/contents.xcplayground +++ b/DemoPlayground.playground/contents.xcplayground @@ -1,5 +1,5 @@ - + diff --git a/DemoPlayground.playground/section-1.swift b/DemoPlayground.playground/section-1.swift index bc4c8c6..d113bcc 100644 --- a/DemoPlayground.playground/section-1.swift +++ b/DemoPlayground.playground/section-1.swift @@ -1,5 +1,9 @@ -import UIKit +import Foundation +// +// If you get an error on the line below you need to run: +// sudo xcrun -sdk macosx swift GenerateCommonCryptoModule.swift macosx +// import CommonCrypto import IDZSwiftCommonCrypto diff --git a/GenerateCommonCryptoModule.swift b/GenerateCommonCryptoModule.swift new file mode 100755 index 0000000..ee48af8 --- /dev/null +++ b/GenerateCommonCryptoModule.swift @@ -0,0 +1,126 @@ +import Foundation + +let verbose = true + +// MARK: - Exception Handling +let handler: @convention(c) (NSException) -> Void = { + exception in + print("FATAL EXCEPTION: \(exception)") + exit(1) +} +NSSetUncaughtExceptionHandler(handler) + +// MARK: - Task Utilities +func runShellCommand(command: String) -> String? { + let args: [String] = command.characters.split { $0 == " " }.map(String.init) + let other = args[1.. Bool { + return NSFileManager.defaultManager().fileExistsAtPath(filePath) +} + +func mkdir(path: String) -> Bool { + do { + try NSFileManager.defaultManager().createDirectoryAtPath(path, withIntermediateDirectories: true, attributes: nil) + return true + } + catch { + return false + } +} + +// MARK: - String Utilities +func trim(s: String) -> String { + return ((s as NSString).stringByTrimmingCharactersInSet(NSCharacterSet.whitespaceAndNewlineCharacterSet()) as String) +} + +func trim(s: String?) -> String? { + return (s == nil) ? nil : (trim(s!) as String) +} + +@noreturn func reportError(message: String) { + print("ERROR: \(message)") + exit(1) +} + +// MARK: GenerateCommonCryptoModule +enum SDK: String { + case iOS = "iphoneos", + iOSSimulator = "iphonesimulator", + watchOS = "watchos", + watchSimulator = "watchsimulator", + tvOS = "appletvos", + tvOSSimulator = "appletvsimulator", + MacOSX = "macosx" + static let all = [iOS, iOSSimulator, watchOS, watchSimulator, tvOS, tvOSSimulator, MacOSX] + +} + +guard let sdk = SDK(rawValue: Process.arguments[1])?.rawValue else { reportError("SDK must be one of \(SDK.all.map { $0.rawValue })") } +guard let sdkVersion = trim(runShellCommand("/usr/bin/xcrun --sdk \(sdk) --show-sdk-version")) else { + reportError("ERROR: Failed to determine SDK version for \(sdk)") +} +guard let sdkPath = trim(runShellCommand("/usr/bin/xcrun --sdk \(sdk) --show-sdk-path")) else { + reportError("ERROR: Failed to determine SDK path for \(sdk)") +} + +if verbose { + print("SDK: \(sdk)") + print("SDK Version: \(sdkVersion)") + print("SDK Path: \(sdkPath)") +} + +let moduleDirectory: String +let moduleFileName: String +if Process.arguments.count > 2 { + moduleDirectory = "\(Process.arguments[2])/Frameworks/\(sdk)/CommonCrypto.framework" + moduleFileName = "module.map" +} +else { + moduleDirectory = "\(sdkPath)/System/Library/Frameworks/CommonCrypto.framework" + moduleFileName = "module.map" + + if fileExists(moduleDirectory) { + reportError("Module directory already exists at \(moduleDirectory).") + } +} + +if !mkdir(moduleDirectory) { + reportError("Failed to create module directory \(moduleDirectory)") +} + +let headerDir = "\(sdkPath)/usr/include/CommonCrypto/" +let headerFile1 = "\(headerDir)/CommonCrypto.h" +let headerFile2 = "\(headerDir)/CommonRandom.h" + +let moduleMapFile = +"module CommonCrypto [system] {\n" + +" header \"\(headerFile1)\"\n" + +" header \"\(headerFile2)\"\n" + +" export *\n" + +"}\n" + +let moduleMapPath = "\(moduleDirectory)/\(moduleFileName)" +do { + try moduleMapFile.writeToFile(moduleMapPath, atomically: true, encoding:NSUTF8StringEncoding) + print("Successfully created module \(moduleMapPath)") + exit(0) +} +catch { + reportError("Failed to write module map file to \(moduleMapPath)") +} + diff --git a/IDZSwiftCommonCrypto.podspec b/IDZSwiftCommonCrypto.podspec index 9314460..a14479a 100644 --- a/IDZSwiftCommonCrypto.podspec +++ b/IDZSwiftCommonCrypto.podspec @@ -1,120 +1,48 @@ -# -# Be sure to run `pod spec lint IDZSwiftCommonCrypto.podspec' to ensure this is a -# valid spec and to remove all comments including this before submitting the spec. -# -# To learn more about Podspec attributes see http://docs.cocoapods.org/specification.html -# To see working Podspecs in the CocoaPods repo see https://github.com/CocoaPods/Specs/ -# - Pod::Spec.new do |s| - # ――― Spec Metadata ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # - # - # These will help people to find your library, and whilst it - # can feel like a chore to fill in it's definitely to your advantage. The - # summary should be tweet-length, and the description more in depth. - # - s.name = "IDZSwiftCommonCrypto" - s.version = "0.6.8" + s.version = "0.7.0" s.summary = "A wrapper for Apple's Common Crypto library written in Swift." s.homepage = "https://github.com/iosdevzone/IDZSwiftCommonCrypto" - - - # ――― Spec License ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # - # - # Licensing your code is important. See http://choosealicense.com for more info. - # CocoaPods will detect a license file if there is a named LICENSE* - # Popular ones are 'MIT', 'BSD' and 'Apache License, Version 2.0'. - # - s.license = "MIT" - # s.license = { :type => "MIT", :file => "FILE_LICENSE" } - - - # ――― Author Metadata ――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # - # - # Specify the authors of the library, with email addresses. Email addresses - # of the authors are extracted from the SCM log. E.g. $ git log. CocoaPods also - # accepts just a name if you'd rather not provide an email address. - # - # Specify a social_media_url where others can refer to, for example a twitter - # profile URL. - # - s.author = { "iOSDevZone" => "idz@iosdeveloperzone.com" } s.social_media_url = "http://twitter.com/iOSDevZone" - s.platform = :ios, "8.0" - # - # Specify the location from where the source should be retrieved. - # Supports git, hg, bzr, svn and HTTP. - # + + s.osx.deployment_target = '10.10' + s.ios.deployment_target = '8.0' + s.tvos.deployment_target = '9.0' + s.watchos.deployment_target = '2.0' s.source = { :git => "https://github.com/iosdevzone/IDZSwiftCommonCrypto.git", :tag => s.version.to_s } - - # ――― Source Code ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # # - # CocoaPods is smart about how it includes source code. For source files - # giving a folder will include any swift, h, m, mm, c & cpp files. - # For header files it will include any header in the folder. - # Not including the public_header_files will make all headers public. + # Create the dummy CommonCrypto.framework structures # s.prepare_command = <<-CMD - touch prepare_command.txt echo 'Running prepare_command' - if [ ! -e CommonCrypto ]; then - pwd - echo Running GenerateCommonCryptoModule - ./GenerateCommonCryptoModule iphonesimulator . - else - echo Skipped GenerateCommonCryptoModule - fi + pwd + echo Running GenerateCommonCryptoModule + swift ./GenerateCommonCryptoModule.swift macosx . + swift ./GenerateCommonCryptoModule.swift iphonesimulator . + swift ./GenerateCommonCryptoModule.swift iphoneos . + swift ./GenerateCommonCryptoModule.swift appletvsimulator . + swift ./GenerateCommonCryptoModule.swift appletvos . + swift ./GenerateCommonCryptoModule.swift watchsimulator . + swift ./GenerateCommonCryptoModule.swift watchos . CMD - s.source_files = "IDZSwiftCommonCrypto" - - # s.public_header_files = "Classes/**/*.h" - - - # ――― Resources ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # - # - # A list of resources included with the Pod. These are copied into the - # target bundle with a build phase script. Anything else will be cleaned. - # You can preserve files from being cleaned, please don't preserve - # non-essential files like tests, examples and documentation. - # - - # s.resource = "icon.png" - # s.resources = "Resources/*.png" - - s.preserve_paths = "CommonCrypto" - - # ――― Project Linking ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # - # - # Link your library with frameworks, or libraries. Libraries do not include - # the lib prefix of their name. - # - - # s.framework = "SomeFramework" - # s.frameworks = "SomeFramework", "AnotherFramework" - - # s.library = "iconv" - # s.libraries = "iconv", "xml2" - - - # ――― Project Settings ――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # - # - # If your library depends on compiler flags you can set them in the xcconfig hash - # where they will only apply to your library. If you depend on other Podspecs - # you can include multiple dependencies to ensure it works. + s.source_files = "IDZSwiftCommonCrypto" - # s.requires_arc = true + # Stop CocoaPods from deleting dummy frameworks + s.preserve_paths = "Frameworks" - s.xcconfig = { "SWIFT_INCLUDE_PATHS" => "$(PROJECT_DIR)/IDZSwiftCommonCrypto" } - # s.dependency "JSONKit", "~> 1.4" + # Make sure we can find the dummy frameworks + s.xcconfig = { + "SWIFT_INCLUDE_PATHS" => "$(PROJECT_DIR)/IDZSwiftCommonCrypto/Frameworks/$(PLATFORM_NAME)", + "FRAMEWORK_SEARCH_PATHS" => "$(PROJECT_DIR)/IDZSwiftCommonCrypto/Frameworks/$(PLATFORM_NAME)" + } end diff --git a/IDZSwiftCommonCrypto.xcodeproj/project.pbxproj b/IDZSwiftCommonCrypto.xcodeproj/project.pbxproj index 3d2fb39..4a0c87a 100644 --- a/IDZSwiftCommonCrypto.xcodeproj/project.pbxproj +++ b/IDZSwiftCommonCrypto.xcodeproj/project.pbxproj @@ -25,11 +25,47 @@ 308499B11BA77BC20025B41D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 308499B01BA77BC20025B41D /* Assets.xcassets */; }; 308499B41BA77BC20025B41D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 308499B21BA77BC20025B41D /* LaunchScreen.storyboard */; }; 308499BF1BA77BC20025B41D /* IDZSwiftCommonCryptoTestAppTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 308499BE1BA77BC20025B41D /* IDZSwiftCommonCryptoTestAppTests.swift */; }; - 308499CA1BA77BC20025B41D /* IDZSwiftCommonCryptoTestAppUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 308499C91BA77BC20025B41D /* IDZSwiftCommonCryptoTestAppUITests.swift */; }; 308499D51BA77F2B0025B41D /* IDZSwiftCommonCrypto.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0CCB89AB19CE05F800068ED6 /* IDZSwiftCommonCrypto.framework */; }; 308499D61BA77F2B0025B41D /* IDZSwiftCommonCrypto.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 0CCB89AB19CE05F800068ED6 /* IDZSwiftCommonCrypto.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 308499DB1BA78C600025B41D /* CommonCryptoAPITests.m in Sources */ = {isa = PBXBuildFile; fileRef = 308499DA1BA78C600025B41D /* CommonCryptoAPITests.m */; }; 308499DC1BA7A4920025B41D /* IDZSwiftCommonCryptoTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0CCB89BA19CE05F800068ED6 /* IDZSwiftCommonCryptoTests.swift */; }; + 309B66A01C3F04F500CF76D5 /* IDZSwiftCommonCrypto.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 309B66961C3F04F500CF76D5 /* IDZSwiftCommonCrypto.framework */; }; + 309B66AF1C3F073D00CF76D5 /* Updateable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3012B11A1BAA237C008504EB /* Updateable.swift */; }; + 309B66B01C3F073D00CF76D5 /* Digest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0CCB89C519CE071D00068ED6 /* Digest.swift */; }; + 309B66B11C3F073D00CF76D5 /* Cryptor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0C9F5B2D19D2948F00E0B5FF /* Cryptor.swift */; }; + 309B66B21C3F073D00CF76D5 /* StreamCryptor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0CCB89C419CE071D00068ED6 /* StreamCryptor.swift */; }; + 309B66B31C3F073D00CF76D5 /* HMAC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0CCB89C619CE071D00068ED6 /* HMAC.swift */; }; + 309B66B41C3F073D00CF76D5 /* KeyDerivation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0CCB89C719CE071D00068ED6 /* KeyDerivation.swift */; }; + 309B66B51C3F073D00CF76D5 /* Random.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0CCB89C819CE071D00068ED6 /* Random.swift */; }; + 309B66B61C3F073D00CF76D5 /* Status.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0C67310119D1EB80009828B8 /* Status.swift */; }; + 309B66B71C3F073D00CF76D5 /* Utilities.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0CCB89D119CF416B00068ED6 /* Utilities.swift */; }; + 309B66B81C3F073D00CF76D5 /* IDZSwiftCommonCrypto.h in Headers */ = {isa = PBXBuildFile; fileRef = 0CCB89B019CE05F800068ED6 /* IDZSwiftCommonCrypto.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 309B66B91C3F073D00CF76D5 /* Crypto.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3050B9B31BA9F7C700177A38 /* Crypto.swift */; }; + 309B66BA1C3F106100CF76D5 /* IDZSwiftCommonCryptoTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0CCB89BA19CE05F800068ED6 /* IDZSwiftCommonCryptoTests.swift */; }; + 309B66CA1C3F13B200CF76D5 /* IDZSwiftCommonCrypto.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 309B66C01C3F13B100CF76D5 /* IDZSwiftCommonCrypto.framework */; }; + 309B66D71C3F13F800CF76D5 /* Updateable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3012B11A1BAA237C008504EB /* Updateable.swift */; }; + 309B66D81C3F13F800CF76D5 /* Digest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0CCB89C519CE071D00068ED6 /* Digest.swift */; }; + 309B66D91C3F13F800CF76D5 /* Cryptor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0C9F5B2D19D2948F00E0B5FF /* Cryptor.swift */; }; + 309B66DA1C3F13F800CF76D5 /* StreamCryptor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0CCB89C419CE071D00068ED6 /* StreamCryptor.swift */; }; + 309B66DB1C3F13F800CF76D5 /* HMAC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0CCB89C619CE071D00068ED6 /* HMAC.swift */; }; + 309B66DC1C3F13F800CF76D5 /* KeyDerivation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0CCB89C719CE071D00068ED6 /* KeyDerivation.swift */; }; + 309B66DD1C3F13F800CF76D5 /* Random.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0CCB89C819CE071D00068ED6 /* Random.swift */; }; + 309B66DE1C3F13F800CF76D5 /* Status.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0C67310119D1EB80009828B8 /* Status.swift */; }; + 309B66DF1C3F13F800CF76D5 /* Utilities.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0CCB89D119CF416B00068ED6 /* Utilities.swift */; }; + 309B66E01C3F13F800CF76D5 /* IDZSwiftCommonCrypto.h in Headers */ = {isa = PBXBuildFile; fileRef = 0CCB89B019CE05F800068ED6 /* IDZSwiftCommonCrypto.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 309B66E11C3F13F800CF76D5 /* Crypto.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3050B9B31BA9F7C700177A38 /* Crypto.swift */; }; + 309B66E21C3F143F00CF76D5 /* IDZSwiftCommonCryptoTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0CCB89BA19CE05F800068ED6 /* IDZSwiftCommonCryptoTests.swift */; }; + 309B66F21C3F19D900CF76D5 /* Updateable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3012B11A1BAA237C008504EB /* Updateable.swift */; }; + 309B66F31C3F19D900CF76D5 /* Digest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0CCB89C519CE071D00068ED6 /* Digest.swift */; }; + 309B66F41C3F19D900CF76D5 /* Cryptor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0C9F5B2D19D2948F00E0B5FF /* Cryptor.swift */; }; + 309B66F51C3F19D900CF76D5 /* StreamCryptor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0CCB89C419CE071D00068ED6 /* StreamCryptor.swift */; }; + 309B66F61C3F19D900CF76D5 /* HMAC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0CCB89C619CE071D00068ED6 /* HMAC.swift */; }; + 309B66F71C3F19D900CF76D5 /* KeyDerivation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0CCB89C719CE071D00068ED6 /* KeyDerivation.swift */; }; + 309B66F81C3F19D900CF76D5 /* Random.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0CCB89C819CE071D00068ED6 /* Random.swift */; }; + 309B66F91C3F19D900CF76D5 /* Status.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0C67310119D1EB80009828B8 /* Status.swift */; }; + 309B66FA1C3F19D900CF76D5 /* Utilities.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0CCB89D119CF416B00068ED6 /* Utilities.swift */; }; + 309B66FB1C3F19D900CF76D5 /* IDZSwiftCommonCrypto.h in Headers */ = {isa = PBXBuildFile; fileRef = 0CCB89B019CE05F800068ED6 /* IDZSwiftCommonCrypto.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 309B66FC1C3F19D900CF76D5 /* Crypto.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3050B9B31BA9F7C700177A38 /* Crypto.swift */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -47,19 +83,26 @@ remoteGlobalIDString = 308499A61BA77BC20025B41D; remoteInfo = IDZSwiftCommonCryptoTestApp; }; - 308499C61BA77BC20025B41D /* PBXContainerItemProxy */ = { + 308499D71BA77F2B0025B41D /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 0CCB89A219CE05F800068ED6 /* Project object */; proxyType = 1; - remoteGlobalIDString = 308499A61BA77BC20025B41D; - remoteInfo = IDZSwiftCommonCryptoTestApp; + remoteGlobalIDString = 0CCB89AA19CE05F800068ED6; + remoteInfo = IDZSwiftCommonCrypto; }; - 308499D71BA77F2B0025B41D /* PBXContainerItemProxy */ = { + 309B66A11C3F04F500CF76D5 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 0CCB89A219CE05F800068ED6 /* Project object */; proxyType = 1; - remoteGlobalIDString = 0CCB89AA19CE05F800068ED6; - remoteInfo = IDZSwiftCommonCrypto; + remoteGlobalIDString = 309B66951C3F04F500CF76D5; + remoteInfo = "IDZSwiftCommonCrypto (OSX)"; + }; + 309B66CB1C3F13B200CF76D5 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 0CCB89A219CE05F800068ED6 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 309B66BF1C3F13B100CF76D5; + remoteInfo = "IDZSwiftCommonCrypto (tvOS)"; }; /* End PBXContainerItemProxy section */ @@ -78,16 +121,13 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ - 0C09D79919E0CFB500A93684 /* README.playground */ = {isa = PBXFileReference; lastKnownFileType = file.playground; path = README.playground; sourceTree = ""; }; - 0C09D79A19E0D4C900A93684 /* README.md */ = {isa = PBXFileReference; explicitFileType = net.daringfireball.markdown; fileEncoding = 4; name = README.md; path = ../README.md; sourceTree = ""; }; 0C3079D619DD47900018E538 /* GenerateCommonCryptoModule */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = GenerateCommonCryptoModule; sourceTree = ""; }; 0C67310119D1EB80009828B8 /* Status.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Status.swift; sourceTree = ""; }; - 0C8D2B7419D2832B00552664 /* DemoPlayground.playground */ = {isa = PBXFileReference; lastKnownFileType = file.playground; path = DemoPlayground.playground; sourceTree = ""; }; 0C9F5B2D19D2948F00E0B5FF /* Cryptor.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Cryptor.swift; sourceTree = ""; }; 0CCB89AB19CE05F800068ED6 /* IDZSwiftCommonCrypto.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = IDZSwiftCommonCrypto.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 0CCB89AF19CE05F800068ED6 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 0CCB89B019CE05F800068ED6 /* IDZSwiftCommonCrypto.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = IDZSwiftCommonCrypto.h; sourceTree = ""; }; - 0CCB89B619CE05F800068ED6 /* IDZSwiftCommonCryptoTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = IDZSwiftCommonCryptoTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 0CCB89B619CE05F800068ED6 /* IDZSwiftCommonCryptoTests (iOS).xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "IDZSwiftCommonCryptoTests (iOS).xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; 0CCB89B919CE05F800068ED6 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 0CCB89BA19CE05F800068ED6 /* IDZSwiftCommonCryptoTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IDZSwiftCommonCryptoTests.swift; sourceTree = ""; }; 0CCB89C419CE071D00068ED6 /* StreamCryptor.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StreamCryptor.swift; sourceTree = ""; }; @@ -108,10 +148,13 @@ 308499BA1BA77BC20025B41D /* IDZSwiftCommonCryptoTestAppTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = IDZSwiftCommonCryptoTestAppTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 308499BE1BA77BC20025B41D /* IDZSwiftCommonCryptoTestAppTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IDZSwiftCommonCryptoTestAppTests.swift; sourceTree = ""; }; 308499C01BA77BC20025B41D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 308499C51BA77BC20025B41D /* IDZSwiftCommonCryptoTestAppUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = IDZSwiftCommonCryptoTestAppUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; - 308499C91BA77BC20025B41D /* IDZSwiftCommonCryptoTestAppUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IDZSwiftCommonCryptoTestAppUITests.swift; sourceTree = ""; }; - 308499CB1BA77BC20025B41D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 308499DA1BA78C600025B41D /* CommonCryptoAPITests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CommonCryptoAPITests.m; sourceTree = ""; }; + 309B668D1C3DF32B00CF76D5 /* GenerateCommonCryptoModule.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GenerateCommonCryptoModule.swift; sourceTree = ""; }; + 309B66961C3F04F500CF76D5 /* IDZSwiftCommonCrypto.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = IDZSwiftCommonCrypto.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 309B669F1C3F04F500CF76D5 /* IDZSwiftCommonCryptoTests (OSX).xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "IDZSwiftCommonCryptoTests (OSX).xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + 309B66C01C3F13B100CF76D5 /* IDZSwiftCommonCrypto.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = IDZSwiftCommonCrypto.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 309B66C91C3F13B200CF76D5 /* IDZSwiftCommonCryptoTests (tvOS).xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "IDZSwiftCommonCryptoTests (tvOS).xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + 309B66E91C3F196500CF76D5 /* IDZSwiftCommonCrypto.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = IDZSwiftCommonCrypto.framework; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -144,7 +187,37 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - 308499C21BA77BC20025B41D /* Frameworks */ = { + 309B66921C3F04F500CF76D5 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 309B669C1C3F04F500CF76D5 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 309B66A01C3F04F500CF76D5 /* IDZSwiftCommonCrypto.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 309B66BC1C3F13B100CF76D5 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 309B66C61C3F13B200CF76D5 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 309B66CA1C3F13B200CF76D5 /* IDZSwiftCommonCrypto.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 309B66E51C3F196500CF76D5 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( @@ -157,15 +230,12 @@ 0CCB89A119CE05F800068ED6 = { isa = PBXGroup; children = ( - 0C09D79A19E0D4C900A93684 /* README.md */, - 0C09D79919E0CFB500A93684 /* README.playground */, + 309B668D1C3DF32B00CF76D5 /* GenerateCommonCryptoModule.swift */, 0C3079D619DD47900018E538 /* GenerateCommonCryptoModule */, - 0C8D2B7419D2832B00552664 /* DemoPlayground.playground */, 0CCB89AD19CE05F800068ED6 /* IDZSwiftCommonCrypto */, 0CCB89B719CE05F800068ED6 /* IDZSwiftCommonCryptoTests */, 308499A81BA77BC20025B41D /* IDZSwiftCommonCryptoTestApp */, 308499BD1BA77BC20025B41D /* IDZSwiftCommonCryptoTestAppTests */, - 308499C81BA77BC20025B41D /* IDZSwiftCommonCryptoTestAppUITests */, 0CCB89AC19CE05F800068ED6 /* Products */, ); sourceTree = ""; @@ -174,10 +244,14 @@ isa = PBXGroup; children = ( 0CCB89AB19CE05F800068ED6 /* IDZSwiftCommonCrypto.framework */, - 0CCB89B619CE05F800068ED6 /* IDZSwiftCommonCryptoTests.xctest */, + 0CCB89B619CE05F800068ED6 /* IDZSwiftCommonCryptoTests (iOS).xctest */, 308499A71BA77BC20025B41D /* IDZSwiftCommonCryptoTestApp.app */, 308499BA1BA77BC20025B41D /* IDZSwiftCommonCryptoTestAppTests.xctest */, - 308499C51BA77BC20025B41D /* IDZSwiftCommonCryptoTestAppUITests.xctest */, + 309B66961C3F04F500CF76D5 /* IDZSwiftCommonCrypto.framework */, + 309B669F1C3F04F500CF76D5 /* IDZSwiftCommonCryptoTests (OSX).xctest */, + 309B66C01C3F13B100CF76D5 /* IDZSwiftCommonCrypto.framework */, + 309B66C91C3F13B200CF76D5 /* IDZSwiftCommonCryptoTests (tvOS).xctest */, + 309B66E91C3F196500CF76D5 /* IDZSwiftCommonCrypto.framework */, ); name = Products; sourceTree = ""; @@ -249,15 +323,6 @@ path = IDZSwiftCommonCryptoTestAppTests; sourceTree = ""; }; - 308499C81BA77BC20025B41D /* IDZSwiftCommonCryptoTestAppUITests */ = { - isa = PBXGroup; - children = ( - 308499C91BA77BC20025B41D /* IDZSwiftCommonCryptoTestAppUITests.swift */, - 308499CB1BA77BC20025B41D /* Info.plist */, - ); - path = IDZSwiftCommonCryptoTestAppUITests; - sourceTree = ""; - }; /* End PBXGroup section */ /* Begin PBXHeadersBuildPhase section */ @@ -269,12 +334,36 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 309B66931C3F04F500CF76D5 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 309B66B81C3F073D00CF76D5 /* IDZSwiftCommonCrypto.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 309B66BD1C3F13B100CF76D5 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 309B66E01C3F13F800CF76D5 /* IDZSwiftCommonCrypto.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 309B66E61C3F196500CF76D5 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 309B66FB1C3F19D900CF76D5 /* IDZSwiftCommonCrypto.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXHeadersBuildPhase section */ /* Begin PBXNativeTarget section */ - 0CCB89AA19CE05F800068ED6 /* IDZSwiftCommonCrypto */ = { + 0CCB89AA19CE05F800068ED6 /* IDZSwiftCommonCrypto (iOS) */ = { isa = PBXNativeTarget; - buildConfigurationList = 0CCB89BE19CE05F800068ED6 /* Build configuration list for PBXNativeTarget "IDZSwiftCommonCrypto" */; + buildConfigurationList = 0CCB89BE19CE05F800068ED6 /* Build configuration list for PBXNativeTarget "IDZSwiftCommonCrypto (iOS)" */; buildPhases = ( 303E19651BAA7E1E00044959 /* ShellScript */, 0CCB89A619CE05F800068ED6 /* Sources */, @@ -286,15 +375,16 @@ ); dependencies = ( ); - name = IDZSwiftCommonCrypto; + name = "IDZSwiftCommonCrypto (iOS)"; productName = IDZSwiftCommonCrypto; productReference = 0CCB89AB19CE05F800068ED6 /* IDZSwiftCommonCrypto.framework */; productType = "com.apple.product-type.framework"; }; - 0CCB89B519CE05F800068ED6 /* IDZSwiftCommonCryptoTests */ = { + 0CCB89B519CE05F800068ED6 /* IDZSwiftCommonCryptoTests (iOS) */ = { isa = PBXNativeTarget; - buildConfigurationList = 0CCB89C119CE05F800068ED6 /* Build configuration list for PBXNativeTarget "IDZSwiftCommonCryptoTests" */; + buildConfigurationList = 0CCB89C119CE05F800068ED6 /* Build configuration list for PBXNativeTarget "IDZSwiftCommonCryptoTests (iOS)" */; buildPhases = ( + 309B668F1C3E045D00CF76D5 /* Run Script */, 0CCB89B219CE05F800068ED6 /* Sources */, 0CCB89B319CE05F800068ED6 /* Frameworks */, 0CCB89B419CE05F800068ED6 /* Resources */, @@ -304,9 +394,9 @@ dependencies = ( 0CCB89CF19CE0EDF00068ED6 /* PBXTargetDependency */, ); - name = IDZSwiftCommonCryptoTests; + name = "IDZSwiftCommonCryptoTests (iOS)"; productName = IDZSwiftCommonCryptoTests; - productReference = 0CCB89B619CE05F800068ED6 /* IDZSwiftCommonCryptoTests.xctest */; + productReference = 0CCB89B619CE05F800068ED6 /* IDZSwiftCommonCryptoTests (iOS).xctest */; productType = "com.apple.product-type.bundle.unit-test"; }; 308499A61BA77BC20025B41D /* IDZSwiftCommonCryptoTestApp */ = { @@ -346,23 +436,99 @@ productReference = 308499BA1BA77BC20025B41D /* IDZSwiftCommonCryptoTestAppTests.xctest */; productType = "com.apple.product-type.bundle.unit-test"; }; - 308499C41BA77BC20025B41D /* IDZSwiftCommonCryptoTestAppUITests */ = { + 309B66951C3F04F500CF76D5 /* IDZSwiftCommonCrypto (OSX) */ = { + isa = PBXNativeTarget; + buildConfigurationList = 309B66A71C3F04F500CF76D5 /* Build configuration list for PBXNativeTarget "IDZSwiftCommonCrypto (OSX)" */; + buildPhases = ( + 309B66AD1C3F051800CF76D5 /* ShellScript */, + 309B66911C3F04F500CF76D5 /* Sources */, + 309B66921C3F04F500CF76D5 /* Frameworks */, + 309B66931C3F04F500CF76D5 /* Headers */, + 309B66941C3F04F500CF76D5 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "IDZSwiftCommonCrypto (OSX)"; + productName = "IDZSwiftCommonCrypto (OSX)"; + productReference = 309B66961C3F04F500CF76D5 /* IDZSwiftCommonCrypto.framework */; + productType = "com.apple.product-type.framework"; + }; + 309B669E1C3F04F500CF76D5 /* IDZSwiftCommonCryptoTests (OSX) */ = { + isa = PBXNativeTarget; + buildConfigurationList = 309B66AA1C3F04F500CF76D5 /* Build configuration list for PBXNativeTarget "IDZSwiftCommonCryptoTests (OSX)" */; + buildPhases = ( + 309B66AE1C3F06A400CF76D5 /* ShellScript */, + 309B669B1C3F04F500CF76D5 /* Sources */, + 309B669C1C3F04F500CF76D5 /* Frameworks */, + 309B669D1C3F04F500CF76D5 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 309B66A21C3F04F500CF76D5 /* PBXTargetDependency */, + ); + name = "IDZSwiftCommonCryptoTests (OSX)"; + productName = "IDZSwiftCommonCrypto (OSX)Tests"; + productReference = 309B669F1C3F04F500CF76D5 /* IDZSwiftCommonCryptoTests (OSX).xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; + 309B66BF1C3F13B100CF76D5 /* IDZSwiftCommonCrypto (tvOS) */ = { + isa = PBXNativeTarget; + buildConfigurationList = 309B66D11C3F13B200CF76D5 /* Build configuration list for PBXNativeTarget "IDZSwiftCommonCrypto (tvOS)" */; + buildPhases = ( + 309B66E31C3F14C600CF76D5 /* ShellScript */, + 309B66BB1C3F13B100CF76D5 /* Sources */, + 309B66BC1C3F13B100CF76D5 /* Frameworks */, + 309B66BD1C3F13B100CF76D5 /* Headers */, + 309B66BE1C3F13B100CF76D5 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "IDZSwiftCommonCrypto (tvOS)"; + productName = "IDZSwiftCommonCrypto (tvOS)"; + productReference = 309B66C01C3F13B100CF76D5 /* IDZSwiftCommonCrypto.framework */; + productType = "com.apple.product-type.framework"; + }; + 309B66C81C3F13B200CF76D5 /* IDZSwiftCommonCryptoTests (tvOS) */ = { isa = PBXNativeTarget; - buildConfigurationList = 308499D41BA77BC20025B41D /* Build configuration list for PBXNativeTarget "IDZSwiftCommonCryptoTestAppUITests" */; + buildConfigurationList = 309B66D41C3F13B200CF76D5 /* Build configuration list for PBXNativeTarget "IDZSwiftCommonCryptoTests (tvOS)" */; buildPhases = ( - 308499C11BA77BC20025B41D /* Sources */, - 308499C21BA77BC20025B41D /* Frameworks */, - 308499C31BA77BC20025B41D /* Resources */, + 309B66C51C3F13B200CF76D5 /* Sources */, + 309B66C61C3F13B200CF76D5 /* Frameworks */, + 309B66C71C3F13B200CF76D5 /* Resources */, ); buildRules = ( ); dependencies = ( - 308499C71BA77BC20025B41D /* PBXTargetDependency */, + 309B66CC1C3F13B200CF76D5 /* PBXTargetDependency */, ); - name = IDZSwiftCommonCryptoTestAppUITests; - productName = IDZSwiftCommonCryptoTestAppUITests; - productReference = 308499C51BA77BC20025B41D /* IDZSwiftCommonCryptoTestAppUITests.xctest */; - productType = "com.apple.product-type.bundle.ui-testing"; + name = "IDZSwiftCommonCryptoTests (tvOS)"; + productName = "IDZSwiftCommonCrypto (tvOS)Tests"; + productReference = 309B66C91C3F13B200CF76D5 /* IDZSwiftCommonCryptoTests (tvOS).xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; + 309B66E81C3F196500CF76D5 /* IDZSwiftCommonCrypto (watchOS) */ = { + isa = PBXNativeTarget; + buildConfigurationList = 309B66EE1C3F196500CF76D5 /* Build configuration list for PBXNativeTarget "IDZSwiftCommonCrypto (watchOS)" */; + buildPhases = ( + 309B66F11C3F197A00CF76D5 /* ShellScript */, + 309B66E41C3F196500CF76D5 /* Sources */, + 309B66E51C3F196500CF76D5 /* Frameworks */, + 309B66E61C3F196500CF76D5 /* Headers */, + 309B66E71C3F196500CF76D5 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "IDZSwiftCommonCrypto (watchOS)"; + productName = "IDZSwiftCommonCrypto (watchOS)"; + productReference = 309B66E91C3F196500CF76D5 /* IDZSwiftCommonCrypto.framework */; + productType = "com.apple.product-type.framework"; }; /* End PBXNativeTarget section */ @@ -371,7 +537,7 @@ isa = PBXProject; attributes = { LastSwiftMigration = 0700; - LastSwiftUpdateCheck = 0700; + LastSwiftUpdateCheck = 0720; LastUpgradeCheck = 0700; ORGANIZATIONNAME = iOSDeveloperZone.com; TargetAttributes = { @@ -388,9 +554,20 @@ CreatedOnToolsVersion = 7.0; TestTargetID = 308499A61BA77BC20025B41D; }; - 308499C41BA77BC20025B41D = { - CreatedOnToolsVersion = 7.0; - TestTargetID = 308499A61BA77BC20025B41D; + 309B66951C3F04F500CF76D5 = { + CreatedOnToolsVersion = 7.2; + }; + 309B669E1C3F04F500CF76D5 = { + CreatedOnToolsVersion = 7.2; + }; + 309B66BF1C3F13B100CF76D5 = { + CreatedOnToolsVersion = 7.2; + }; + 309B66C81C3F13B200CF76D5 = { + CreatedOnToolsVersion = 7.2; + }; + 309B66E81C3F196500CF76D5 = { + CreatedOnToolsVersion = 7.2; }; }; }; @@ -407,11 +584,15 @@ projectDirPath = ""; projectRoot = ""; targets = ( - 0CCB89AA19CE05F800068ED6 /* IDZSwiftCommonCrypto */, - 0CCB89B519CE05F800068ED6 /* IDZSwiftCommonCryptoTests */, + 0CCB89AA19CE05F800068ED6 /* IDZSwiftCommonCrypto (iOS) */, + 309B66951C3F04F500CF76D5 /* IDZSwiftCommonCrypto (OSX) */, + 309B66E81C3F196500CF76D5 /* IDZSwiftCommonCrypto (watchOS) */, + 309B66BF1C3F13B100CF76D5 /* IDZSwiftCommonCrypto (tvOS) */, + 0CCB89B519CE05F800068ED6 /* IDZSwiftCommonCryptoTests (iOS) */, + 309B669E1C3F04F500CF76D5 /* IDZSwiftCommonCryptoTests (OSX) */, + 309B66C81C3F13B200CF76D5 /* IDZSwiftCommonCryptoTests (tvOS) */, 308499A61BA77BC20025B41D /* IDZSwiftCommonCryptoTestApp */, 308499B91BA77BC20025B41D /* IDZSwiftCommonCryptoTestAppTests */, - 308499C41BA77BC20025B41D /* IDZSwiftCommonCryptoTestAppUITests */, ); }; /* End PBXProject section */ @@ -448,7 +629,35 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - 308499C31BA77BC20025B41D /* Resources */ = { + 309B66941C3F04F500CF76D5 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 309B669D1C3F04F500CF76D5 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 309B66BE1C3F13B100CF76D5 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 309B66C71C3F13B200CF76D5 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 309B66E71C3F196500CF76D5 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( @@ -469,7 +678,73 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/bash; - shellScript = "echo Checking for $PROJECT_DIR/CommonCrypto\nif [ ! -e $PROJECT_DIR/CommonCrypto ] ; then\necho Generating $PROJECT_DIR/CommonCrypto\n./GenerateCommonCryptoModule iphonesimulator9.0 $PROJECT_DIR\nelse\necho Directory exists, skipping generation of $PROJECT_DIR/CommonCrypto\nfi"; + shellScript = "if [ ! -e $PROJECT_DIR/Frameworks/$PLATFORM_NAME ] ; then\n echo Generating $PROJECT_DIR/Frameworks/$(PLATFORM_NAME)/CommonCrypto.framework\n xcrun -sdk macosx swift ./GenerateCommonCryptoModule.swift $PLATFORM_NAME $PROJECT_DIR\nelse\n echo Directory exists, skipping generation of $PROJECT_DIR/Frameworks/$(PLATFORM_NAME)/CommonCrypto.framework\nfi"; + }; + 309B668F1C3E045D00CF76D5 /* Run Script */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Run Script"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "echo FRAMEWORK_SEARCH_PATHS is $FRAMEWORK_SEARCH_PATHS"; + }; + 309B66AD1C3F051800CF76D5 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "echo Checking for $PROJECT_DIR/CommonCrypto\necho SDKROOT is $SDKROOT\necho PLATFORM_NAME is $PLATFORM_NAME\necho FRAMEWORK_SEARCH_PATHS is $FRAMEWORK_SEARCH_PATHS\n\n#if [ ! -e $PROJECT_DIR/CommonCrypto ] ; then\n#echo Generating $PROJECT_DIR/CommonCrypto\nSWIFT_SDK=`xcrun --show-sdk-path -sdk macosx`\necho SWIFT_SDK is $SWIFT_SDK\nswift -sdk $SWIFT_SDK ./GenerateCommonCryptoModule.swift $PLATFORM_NAME $PROJECT_DIR\n#else\n#echo Directory exists, skipping generation of $PROJECT_DIR/CommonCrypto\n#fi"; + }; + 309B66AE1C3F06A400CF76D5 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "echo FRAMEWORK_SEARCH_PATHS is $FRAMEWORK_SEARCH_PATHS"; + }; + 309B66E31C3F14C600CF76D5 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "echo Checking for $PROJECT_DIR/CommonCrypto\necho SDKROOT is $SDKROOT\necho PLATFORM_NAME is $PLATFORM_NAME\necho FRAMEWORK_SEARCH_PATHS is $FRAMEWORK_SEARCH_PATHS\n\n#if [ ! -e $PROJECT_DIR/CommonCrypto ] ; then\n#echo Generating $PROJECT_DIR/CommonCrypto\nSWIFT_SDK=`xcrun --show-sdk-path -sdk macosx`\necho SWIFT_SDK is $SWIFT_SDK\nxcrun -sdk macosx swift ./GenerateCommonCryptoModule.swift $PLATFORM_NAME $PROJECT_DIR\n#else\n#echo Directory exists, skipping generation of $PROJECT_DIR/CommonCrypto\n#fi"; + }; + 309B66F11C3F197A00CF76D5 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "echo Checking for $PROJECT_DIR/CommonCrypto\necho SDKROOT is $SDKROOT\necho PLATFORM_NAME is $PLATFORM_NAME\necho FRAMEWORK_SEARCH_PATHS is $FRAMEWORK_SEARCH_PATHS\n\n#if [ ! -e $PROJECT_DIR/CommonCrypto ] ; then\n#echo Generating $PROJECT_DIR/CommonCrypto\nSWIFT_SDK=`xcrun --show-sdk-path -sdk macosx`\necho SWIFT_SDK is $SWIFT_SDK\nxcrun -sdk macosx swift ./GenerateCommonCryptoModule.swift $PLATFORM_NAME $PROJECT_DIR\n#else\n#echo Directory exists, skipping generation of $PROJECT_DIR/CommonCrypto\n#fi"; }; /* End PBXShellScriptBuildPhase section */ @@ -518,11 +793,70 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - 308499C11BA77BC20025B41D /* Sources */ = { + 309B66911C3F04F500CF76D5 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 309B66AF1C3F073D00CF76D5 /* Updateable.swift in Sources */, + 309B66B31C3F073D00CF76D5 /* HMAC.swift in Sources */, + 309B66B91C3F073D00CF76D5 /* Crypto.swift in Sources */, + 309B66B21C3F073D00CF76D5 /* StreamCryptor.swift in Sources */, + 309B66B61C3F073D00CF76D5 /* Status.swift in Sources */, + 309B66B01C3F073D00CF76D5 /* Digest.swift in Sources */, + 309B66B41C3F073D00CF76D5 /* KeyDerivation.swift in Sources */, + 309B66B71C3F073D00CF76D5 /* Utilities.swift in Sources */, + 309B66B11C3F073D00CF76D5 /* Cryptor.swift in Sources */, + 309B66B51C3F073D00CF76D5 /* Random.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 309B669B1C3F04F500CF76D5 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 309B66BA1C3F106100CF76D5 /* IDZSwiftCommonCryptoTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 309B66BB1C3F13B100CF76D5 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 309B66D71C3F13F800CF76D5 /* Updateable.swift in Sources */, + 309B66DB1C3F13F800CF76D5 /* HMAC.swift in Sources */, + 309B66E11C3F13F800CF76D5 /* Crypto.swift in Sources */, + 309B66DA1C3F13F800CF76D5 /* StreamCryptor.swift in Sources */, + 309B66DE1C3F13F800CF76D5 /* Status.swift in Sources */, + 309B66D81C3F13F800CF76D5 /* Digest.swift in Sources */, + 309B66DC1C3F13F800CF76D5 /* KeyDerivation.swift in Sources */, + 309B66DF1C3F13F800CF76D5 /* Utilities.swift in Sources */, + 309B66D91C3F13F800CF76D5 /* Cryptor.swift in Sources */, + 309B66DD1C3F13F800CF76D5 /* Random.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 309B66C51C3F13B200CF76D5 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 309B66E21C3F143F00CF76D5 /* IDZSwiftCommonCryptoTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 309B66E41C3F196500CF76D5 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 308499CA1BA77BC20025B41D /* IDZSwiftCommonCryptoTestAppUITests.swift in Sources */, + 309B66F21C3F19D900CF76D5 /* Updateable.swift in Sources */, + 309B66F61C3F19D900CF76D5 /* HMAC.swift in Sources */, + 309B66FC1C3F19D900CF76D5 /* Crypto.swift in Sources */, + 309B66F51C3F19D900CF76D5 /* StreamCryptor.swift in Sources */, + 309B66F91C3F19D900CF76D5 /* Status.swift in Sources */, + 309B66F31C3F19D900CF76D5 /* Digest.swift in Sources */, + 309B66F71C3F19D900CF76D5 /* KeyDerivation.swift in Sources */, + 309B66FA1C3F19D900CF76D5 /* Utilities.swift in Sources */, + 309B66F41C3F19D900CF76D5 /* Cryptor.swift in Sources */, + 309B66F81C3F19D900CF76D5 /* Random.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -531,7 +865,7 @@ /* Begin PBXTargetDependency section */ 0CCB89CF19CE0EDF00068ED6 /* PBXTargetDependency */ = { isa = PBXTargetDependency; - target = 0CCB89AA19CE05F800068ED6 /* IDZSwiftCommonCrypto */; + target = 0CCB89AA19CE05F800068ED6 /* IDZSwiftCommonCrypto (iOS) */; targetProxy = 0CCB89CE19CE0EDF00068ED6 /* PBXContainerItemProxy */; }; 308499BC1BA77BC20025B41D /* PBXTargetDependency */ = { @@ -539,16 +873,21 @@ target = 308499A61BA77BC20025B41D /* IDZSwiftCommonCryptoTestApp */; targetProxy = 308499BB1BA77BC20025B41D /* PBXContainerItemProxy */; }; - 308499C71BA77BC20025B41D /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 308499A61BA77BC20025B41D /* IDZSwiftCommonCryptoTestApp */; - targetProxy = 308499C61BA77BC20025B41D /* PBXContainerItemProxy */; - }; 308499D81BA77F2B0025B41D /* PBXTargetDependency */ = { isa = PBXTargetDependency; - target = 0CCB89AA19CE05F800068ED6 /* IDZSwiftCommonCrypto */; + target = 0CCB89AA19CE05F800068ED6 /* IDZSwiftCommonCrypto (iOS) */; targetProxy = 308499D71BA77F2B0025B41D /* PBXContainerItemProxy */; }; + 309B66A21C3F04F500CF76D5 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 309B66951C3F04F500CF76D5 /* IDZSwiftCommonCrypto (OSX) */; + targetProxy = 309B66A11C3F04F500CF76D5 /* PBXContainerItemProxy */; + }; + 309B66CC1C3F13B200CF76D5 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 309B66BF1C3F13B100CF76D5 /* IDZSwiftCommonCrypto (tvOS) */; + targetProxy = 309B66CB1C3F13B200CF76D5 /* PBXContainerItemProxy */; + }; /* End PBXTargetDependency section */ /* Begin PBXVariantGroup section */ @@ -593,6 +932,7 @@ CURRENT_PROJECT_VERSION = 1; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; + FRAMEWORK_SEARCH_PATHS = "$(PROJECT_DIR)/Frameworks/$(PLATFORM_NAME)"; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_GENERATE_TEST_COVERAGE_FILES = YES; @@ -642,6 +982,7 @@ CURRENT_PROJECT_VERSION = 1; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; + FRAMEWORK_SEARCH_PATHS = "$(PROJECT_DIR)/Frameworks/$(PLATFORM_NAME)"; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_GENERATE_TEST_COVERAGE_FILES = YES; GCC_INSTRUMENT_PROGRAM_FLOW_ARCS = YES; @@ -668,17 +1009,14 @@ DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)", - ); INFOPLIST_FILE = IDZSwiftCommonCrypto/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "com.iosdeveloperzone.$(PRODUCT_NAME:rfc1034identifier)"; - PRODUCT_NAME = "$(TARGET_NAME)"; + PRODUCT_NAME = IDZSwiftCommonCrypto; SKIP_INSTALL = YES; SWIFT_INCLUDE_PATHS = "${SRCROOT}"; + SYMROOT = "build/$(PLATFORM_NAME)"; }; name = Debug; }; @@ -689,17 +1027,14 @@ DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)", - ); INFOPLIST_FILE = IDZSwiftCommonCrypto/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "com.iosdeveloperzone.$(PRODUCT_NAME:rfc1034identifier)"; - PRODUCT_NAME = "$(TARGET_NAME)"; + PRODUCT_NAME = IDZSwiftCommonCrypto; SKIP_INSTALL = YES; SWIFT_INCLUDE_PATHS = "${SRCROOT}"; + SYMROOT = "build/$(PLATFORM_NAME)"; }; name = Release; }; @@ -804,35 +1139,200 @@ }; name = Release; }; - 308499D01BA77BC20025B41D /* Debug */ = { + 309B66A81C3F04F500CF76D5 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + CODE_SIGN_IDENTITY = "-"; + COMBINE_HIDPI_IMAGES = YES; DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_TESTABILITY = YES; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + FRAMEWORK_VERSION = A; GCC_NO_COMMON_BLOCKS = YES; - INFOPLIST_FILE = IDZSwiftCommonCryptoTestAppUITests/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + INFOPLIST_FILE = IDZSwiftCommonCrypto/Info.plist; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; + MACOSX_DEPLOYMENT_TARGET = 10.11; + PRODUCT_BUNDLE_IDENTIFIER = "com.iosdeveloperzone.IDZSwiftCommonCrypto--OSX-"; + PRODUCT_NAME = IDZSwiftCommonCrypto; + SDKROOT = macosx; + SKIP_INSTALL = YES; + }; + name = Debug; + }; + 309B66A91C3F04F500CF76D5 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_IDENTITY = "-"; + COMBINE_HIDPI_IMAGES = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + FRAMEWORK_VERSION = A; + GCC_NO_COMMON_BLOCKS = YES; + INFOPLIST_FILE = IDZSwiftCommonCrypto/Info.plist; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; + MACOSX_DEPLOYMENT_TARGET = 10.11; + PRODUCT_BUNDLE_IDENTIFIER = "com.iosdeveloperzone.IDZSwiftCommonCrypto--OSX-"; + PRODUCT_NAME = IDZSwiftCommonCrypto; + SDKROOT = macosx; + SKIP_INSTALL = YES; + }; + name = Release; + }; + 309B66AB1C3F04F500CF76D5 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_IDENTITY = "-"; + COMBINE_HIDPI_IMAGES = YES; + DEBUG_INFORMATION_FORMAT = dwarf; + GCC_NO_COMMON_BLOCKS = YES; + INFOPLIST_FILE = IDZSwiftCommonCryptoTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; + MACOSX_DEPLOYMENT_TARGET = 10.11; + PRODUCT_BUNDLE_IDENTIFIER = "com.iosdeveloperzone.IDZSwiftCommonCrypto--OSX-Tests"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = macosx; + }; + name = Debug; + }; + 309B66AC1C3F04F500CF76D5 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_IDENTITY = "-"; + COMBINE_HIDPI_IMAGES = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + GCC_NO_COMMON_BLOCKS = YES; + INFOPLIST_FILE = IDZSwiftCommonCryptoTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; + MACOSX_DEPLOYMENT_TARGET = 10.11; + PRODUCT_BUNDLE_IDENTIFIER = "com.iosdeveloperzone.IDZSwiftCommonCrypto--OSX-Tests"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = macosx; + }; + name = Release; + }; + 309B66D21C3F13B200CF76D5 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + DEBUG_INFORMATION_FORMAT = dwarf; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + GCC_NO_COMMON_BLOCKS = YES; + INFOPLIST_FILE = IDZSwiftCommonCrypto/Info.plist; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "com.iosdeveloperzone.IDZSwiftCommonCrypto--tvOS-"; + PRODUCT_NAME = IDZSwiftCommonCrypto; + SDKROOT = appletvos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = 3; + TVOS_DEPLOYMENT_TARGET = 9.1; + }; + name = Debug; + }; + 309B66D31C3F13B200CF76D5 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + GCC_NO_COMMON_BLOCKS = YES; + INFOPLIST_FILE = IDZSwiftCommonCrypto/Info.plist; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "com.iosdeveloperzone.IDZSwiftCommonCrypto--tvOS-"; + PRODUCT_NAME = IDZSwiftCommonCrypto; + SDKROOT = appletvos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = 3; + TVOS_DEPLOYMENT_TARGET = 9.1; + }; + name = Release; + }; + 309B66D51C3F13B200CF76D5 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + DEBUG_INFORMATION_FORMAT = dwarf; + GCC_NO_COMMON_BLOCKS = YES; + INFOPLIST_FILE = IDZSwiftCommonCrypto/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.iosdeveloperzone.IDZSwiftCommonCryptoTestAppUITests; + PRODUCT_BUNDLE_IDENTIFIER = "com.iosdeveloperzone.IDZSwiftCommonCrypto--tvOS-Tests"; PRODUCT_NAME = "$(TARGET_NAME)"; - TEST_TARGET_NAME = IDZSwiftCommonCryptoTestApp; - USES_XCTRUNNER = YES; + SDKROOT = appletvos; + TVOS_DEPLOYMENT_TARGET = 9.1; }; name = Debug; }; - 308499D11BA77BC20025B41D /* Release */ = { + 309B66D61C3F13B200CF76D5 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; GCC_NO_COMMON_BLOCKS = YES; - INFOPLIST_FILE = IDZSwiftCommonCryptoTestAppUITests/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + INFOPLIST_FILE = IDZSwiftCommonCrypto/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.iosdeveloperzone.IDZSwiftCommonCryptoTestAppUITests; + PRODUCT_BUNDLE_IDENTIFIER = "com.iosdeveloperzone.IDZSwiftCommonCrypto--tvOS-Tests"; PRODUCT_NAME = "$(TARGET_NAME)"; - TEST_TARGET_NAME = IDZSwiftCommonCryptoTestApp; - USES_XCTRUNNER = YES; + SDKROOT = appletvos; + TVOS_DEPLOYMENT_TARGET = 9.1; + }; + name = Release; + }; + 309B66EF1C3F196500CF76D5 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; + DEBUG_INFORMATION_FORMAT = dwarf; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + GCC_NO_COMMON_BLOCKS = YES; + INFOPLIST_FILE = IDZSwiftCommonCrypto/Info.plist; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "com.iosdeveloperzone.IDZSwiftCommonCrypto--watchOS-"; + PRODUCT_NAME = IDZSwiftCommonCrypto; + SDKROOT = watchos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = 4; + WATCHOS_DEPLOYMENT_TARGET = 2.1; + }; + name = Debug; + }; + 309B66F01C3F196500CF76D5 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + GCC_NO_COMMON_BLOCKS = YES; + INFOPLIST_FILE = IDZSwiftCommonCrypto/Info.plist; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "com.iosdeveloperzone.IDZSwiftCommonCrypto--watchOS-"; + PRODUCT_NAME = IDZSwiftCommonCrypto; + SDKROOT = watchos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = 4; + WATCHOS_DEPLOYMENT_TARGET = 2.1; }; name = Release; }; @@ -848,7 +1348,7 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 0CCB89BE19CE05F800068ED6 /* Build configuration list for PBXNativeTarget "IDZSwiftCommonCrypto" */ = { + 0CCB89BE19CE05F800068ED6 /* Build configuration list for PBXNativeTarget "IDZSwiftCommonCrypto (iOS)" */ = { isa = XCConfigurationList; buildConfigurations = ( 0CCB89BF19CE05F800068ED6 /* Debug */, @@ -857,7 +1357,7 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 0CCB89C119CE05F800068ED6 /* Build configuration list for PBXNativeTarget "IDZSwiftCommonCryptoTests" */ = { + 0CCB89C119CE05F800068ED6 /* Build configuration list for PBXNativeTarget "IDZSwiftCommonCryptoTests (iOS)" */ = { isa = XCConfigurationList; buildConfigurations = ( 0CCB89C219CE05F800068ED6 /* Debug */, @@ -884,11 +1384,47 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 308499D41BA77BC20025B41D /* Build configuration list for PBXNativeTarget "IDZSwiftCommonCryptoTestAppUITests" */ = { + 309B66A71C3F04F500CF76D5 /* Build configuration list for PBXNativeTarget "IDZSwiftCommonCrypto (OSX)" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 309B66A81C3F04F500CF76D5 /* Debug */, + 309B66A91C3F04F500CF76D5 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 309B66AA1C3F04F500CF76D5 /* Build configuration list for PBXNativeTarget "IDZSwiftCommonCryptoTests (OSX)" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 309B66AB1C3F04F500CF76D5 /* Debug */, + 309B66AC1C3F04F500CF76D5 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 309B66D11C3F13B200CF76D5 /* Build configuration list for PBXNativeTarget "IDZSwiftCommonCrypto (tvOS)" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 309B66D21C3F13B200CF76D5 /* Debug */, + 309B66D31C3F13B200CF76D5 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 309B66D41C3F13B200CF76D5 /* Build configuration list for PBXNativeTarget "IDZSwiftCommonCryptoTests (tvOS)" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 309B66D51C3F13B200CF76D5 /* Debug */, + 309B66D61C3F13B200CF76D5 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 309B66EE1C3F196500CF76D5 /* Build configuration list for PBXNativeTarget "IDZSwiftCommonCrypto (watchOS)" */ = { isa = XCConfigurationList; buildConfigurations = ( - 308499D01BA77BC20025B41D /* Debug */, - 308499D11BA77BC20025B41D /* Release */, + 309B66EF1C3F196500CF76D5 /* Debug */, + 309B66F01C3F196500CF76D5 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; diff --git a/IDZSwiftCommonCrypto.xcodeproj/xcshareddata/xcschemes/IDZSwiftCommonCryptoTests.xcscheme b/IDZSwiftCommonCrypto.xcodeproj/xcshareddata/xcschemes/IDZSwiftCommonCrypto (OSX).xcscheme similarity index 72% rename from IDZSwiftCommonCrypto.xcodeproj/xcshareddata/xcschemes/IDZSwiftCommonCryptoTests.xcscheme rename to IDZSwiftCommonCrypto.xcodeproj/xcshareddata/xcschemes/IDZSwiftCommonCrypto (OSX).xcscheme index 3884eee..089ef14 100644 --- a/IDZSwiftCommonCrypto.xcodeproj/xcshareddata/xcschemes/IDZSwiftCommonCryptoTests.xcscheme +++ b/IDZSwiftCommonCrypto.xcodeproj/xcshareddata/xcschemes/IDZSwiftCommonCrypto (OSX).xcscheme @@ -1,6 +1,6 @@ @@ -32,9 +32,9 @@ skipped = "NO"> @@ -42,9 +42,9 @@ @@ -52,7 +52,7 @@ @@ -82,9 +82,9 @@ diff --git a/IDZSwiftCommonCrypto.xcodeproj/xcshareddata/xcschemes/IDZSwiftCommonCrypto (Release).xcscheme b/IDZSwiftCommonCrypto.xcodeproj/xcshareddata/xcschemes/IDZSwiftCommonCrypto (Release).xcscheme index 312b8c3..dbe3901 100644 --- a/IDZSwiftCommonCrypto.xcodeproj/xcshareddata/xcschemes/IDZSwiftCommonCrypto (Release).xcscheme +++ b/IDZSwiftCommonCrypto.xcodeproj/xcshareddata/xcschemes/IDZSwiftCommonCrypto (Release).xcscheme @@ -16,7 +16,7 @@ BuildableIdentifier = "primary" BlueprintIdentifier = "0CCB89AA19CE05F800068ED6" BuildableName = "IDZSwiftCommonCrypto.framework" - BlueprintName = "IDZSwiftCommonCrypto" + BlueprintName = "IDZSwiftCommonCrypto (iOS)" ReferencedContainer = "container:IDZSwiftCommonCrypto.xcodeproj"> @@ -33,8 +33,8 @@ @@ -44,7 +44,7 @@ BuildableIdentifier = "primary" BlueprintIdentifier = "0CCB89AA19CE05F800068ED6" BuildableName = "IDZSwiftCommonCrypto.framework" - BlueprintName = "IDZSwiftCommonCrypto" + BlueprintName = "IDZSwiftCommonCrypto (iOS)" ReferencedContainer = "container:IDZSwiftCommonCrypto.xcodeproj"> @@ -66,7 +66,7 @@ BuildableIdentifier = "primary" BlueprintIdentifier = "0CCB89AA19CE05F800068ED6" BuildableName = "IDZSwiftCommonCrypto.framework" - BlueprintName = "IDZSwiftCommonCrypto" + BlueprintName = "IDZSwiftCommonCrypto (iOS)" ReferencedContainer = "container:IDZSwiftCommonCrypto.xcodeproj"> @@ -84,7 +84,7 @@ BuildableIdentifier = "primary" BlueprintIdentifier = "0CCB89AA19CE05F800068ED6" BuildableName = "IDZSwiftCommonCrypto.framework" - BlueprintName = "IDZSwiftCommonCrypto" + BlueprintName = "IDZSwiftCommonCrypto (iOS)" ReferencedContainer = "container:IDZSwiftCommonCrypto.xcodeproj"> diff --git a/IDZSwiftCommonCrypto.xcodeproj/xcshareddata/xcschemes/IDZSwiftCommonCrypto.xcscheme b/IDZSwiftCommonCrypto.xcodeproj/xcshareddata/xcschemes/IDZSwiftCommonCrypto (iOS).xcscheme similarity index 90% rename from IDZSwiftCommonCrypto.xcodeproj/xcshareddata/xcschemes/IDZSwiftCommonCrypto.xcscheme rename to IDZSwiftCommonCrypto.xcodeproj/xcshareddata/xcschemes/IDZSwiftCommonCrypto (iOS).xcscheme index 30c68f7..aaa16ec 100644 --- a/IDZSwiftCommonCrypto.xcodeproj/xcshareddata/xcschemes/IDZSwiftCommonCrypto.xcscheme +++ b/IDZSwiftCommonCrypto.xcodeproj/xcshareddata/xcschemes/IDZSwiftCommonCrypto (iOS).xcscheme @@ -16,7 +16,7 @@ BuildableIdentifier = "primary" BlueprintIdentifier = "0CCB89AA19CE05F800068ED6" BuildableName = "IDZSwiftCommonCrypto.framework" - BlueprintName = "IDZSwiftCommonCrypto" + BlueprintName = "IDZSwiftCommonCrypto (iOS)" ReferencedContainer = "container:IDZSwiftCommonCrypto.xcodeproj"> @@ -34,8 +34,8 @@ @@ -45,7 +45,7 @@ BuildableIdentifier = "primary" BlueprintIdentifier = "0CCB89AA19CE05F800068ED6" BuildableName = "IDZSwiftCommonCrypto.framework" - BlueprintName = "IDZSwiftCommonCrypto" + BlueprintName = "IDZSwiftCommonCrypto (iOS)" ReferencedContainer = "container:IDZSwiftCommonCrypto.xcodeproj"> @@ -67,7 +67,7 @@ BuildableIdentifier = "primary" BlueprintIdentifier = "0CCB89AA19CE05F800068ED6" BuildableName = "IDZSwiftCommonCrypto.framework" - BlueprintName = "IDZSwiftCommonCrypto" + BlueprintName = "IDZSwiftCommonCrypto (iOS)" ReferencedContainer = "container:IDZSwiftCommonCrypto.xcodeproj"> @@ -85,7 +85,7 @@ BuildableIdentifier = "primary" BlueprintIdentifier = "0CCB89AA19CE05F800068ED6" BuildableName = "IDZSwiftCommonCrypto.framework" - BlueprintName = "IDZSwiftCommonCrypto" + BlueprintName = "IDZSwiftCommonCrypto (iOS)" ReferencedContainer = "container:IDZSwiftCommonCrypto.xcodeproj"> diff --git a/IDZSwiftCommonCrypto.xcodeproj/xcshareddata/xcschemes/IDZSwiftCommonCrypto (tvOS).xcscheme b/IDZSwiftCommonCrypto.xcodeproj/xcshareddata/xcschemes/IDZSwiftCommonCrypto (tvOS).xcscheme new file mode 100644 index 0000000..27eed32 --- /dev/null +++ b/IDZSwiftCommonCrypto.xcodeproj/xcshareddata/xcschemes/IDZSwiftCommonCrypto (tvOS).xcscheme @@ -0,0 +1,99 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/IDZSwiftCommonCrypto.xcodeproj/xcshareddata/xcschemes/IDZSwiftCommonCrypto (watchOS).xcscheme b/IDZSwiftCommonCrypto.xcodeproj/xcshareddata/xcschemes/IDZSwiftCommonCrypto (watchOS).xcscheme new file mode 100644 index 0000000..ecfa21b --- /dev/null +++ b/IDZSwiftCommonCrypto.xcodeproj/xcshareddata/xcschemes/IDZSwiftCommonCrypto (watchOS).xcscheme @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/IDZSwiftCommonCrypto.xcodeproj/xcshareddata/xcschemes/IDZSwiftCommonCryptoTestApp.xcscheme b/IDZSwiftCommonCrypto.xcodeproj/xcshareddata/xcschemes/IDZSwiftCommonCryptoTestApp.xcscheme new file mode 100644 index 0000000..3ced91b --- /dev/null +++ b/IDZSwiftCommonCrypto.xcodeproj/xcshareddata/xcschemes/IDZSwiftCommonCryptoTestApp.xcscheme @@ -0,0 +1,111 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/IDZSwiftCommonCryptoTests/IDZSwiftCommonCryptoTests.swift b/IDZSwiftCommonCryptoTests/IDZSwiftCommonCryptoTests.swift index 51e7d5e..0d0602c 100644 --- a/IDZSwiftCommonCryptoTests/IDZSwiftCommonCryptoTests.swift +++ b/IDZSwiftCommonCryptoTests/IDZSwiftCommonCryptoTests.swift @@ -6,9 +6,9 @@ // Copyright (c) 2014 iOSDeveloperZone.com. All rights reserved. // -import UIKit +import Foundation import XCTest -import IDZSwiftCommonCrypto +@testable import IDZSwiftCommonCrypto import CommonCrypto class IDZSwiftCommonCryptoTests: XCTestCase { diff --git a/Makefile b/Makefile index 7fd3e3b..449411b 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ REPO=IDZPodspecs NAME=IDZSwiftCommonCrypto -OS=9.1 +IOS_VERSION=9.2 PG=README.playground RSRC_DIR=$(PG)/Resources @@ -15,6 +15,15 @@ $(PG): README.md cp Riscal.jpg ${RSRC_DIR} git config --global push.default simple git diff-files --exit-code; if [[ "$?" == "1" ]]; then git commit -a -m "Playground update from Travis [ci skip]"; git push; fi +all: + $(XC) build -target "IDZSwiftCommonCrypto (iOS)" | xcpretty + $(XC) build -target "IDZSwiftCommonCrypto (OSX)" | xcpretty + $(XC) build -target "IDZSwiftCommonCrypto (tvOS)" | xcpretty + $(XC) build -target "IDZSwiftCommonCrypto (watchOS)" | xcpretty + $(XC) test -scheme "IDZSwiftCommonCrypto (iOS)" -destination 'platform=iOS Simulator,name=iPhone 6' | xcpretty + $(XC) test -scheme "IDZSwiftCommonCrypto (OSX)" | xcpretty + $(XC) test -scheme "IDZSwiftCommonCrypto (tvOS)" -destination 'platform=tvOS Simulator,name=Apple TV 1080p'| xcpretty + # # Build # diff --git a/README.playground/contents.xcplayground b/README.playground/contents.xcplayground index 26af4d1..fcd17e2 100644 --- a/README.playground/contents.xcplayground +++ b/README.playground/contents.xcplayground @@ -1,43 +1,25 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/README.playground/section-1-original.swift b/README.playground/section-1-original.swift new file mode 100644 index 0000000..2f80be0 --- /dev/null +++ b/README.playground/section-1-original.swift @@ -0,0 +1 @@ +import IDZSwiftCommonCrypto \ No newline at end of file diff --git a/README.playground/section-1.swift b/README.playground/section-1.swift index 2f80be0..8f9c0a9 100644 --- a/README.playground/section-1.swift +++ b/README.playground/section-1.swift @@ -1 +1,2 @@ -import IDZSwiftCommonCrypto \ No newline at end of file +import Cocoa +import IDZSwiftCommonCrypto diff --git a/README.playground/section-11-original.swift b/README.playground/section-11-original.swift new file mode 100644 index 0000000..34df412 --- /dev/null +++ b/README.playground/section-11-original.swift @@ -0,0 +1,8 @@ +var keys5 = arrayFromHexString("0102030405060708090a0b0c0d0e0f10111213141516171819") +var datas5 : [UInt8] = Array(count:50, repeatedValue:0xcd) +var expecteds5 = arrayFromHexString("4c9007f4026250c6bc8414f9bf50c86c2d7235da") +var hmacs5 = HMAC(algorithm:.SHA1, key:keys5).update(datas5)?.final() + +// RFC2202 says this should be 4c9007f4026250c6bc8414f9bf50c86c2d7235da +let expectedRFC2202 = arrayFromHexString("4c9007f4026250c6bc8414f9bf50c86c2d7235da") +assert(hmacs5! == expectedRFC2202) \ No newline at end of file diff --git a/README.playground/section-11.swift b/README.playground/section-11.swift index 34df412..3adfedc 100644 --- a/README.playground/section-11.swift +++ b/README.playground/section-11.swift @@ -5,4 +5,4 @@ var hmacs5 = HMAC(algorithm:.SHA1, key:keys5).update(datas5)?.final() // RFC2202 says this should be 4c9007f4026250c6bc8414f9bf50c86c2d7235da let expectedRFC2202 = arrayFromHexString("4c9007f4026250c6bc8414f9bf50c86c2d7235da") -assert(hmacs5! == expectedRFC2202) \ No newline at end of file +assert(hmacs5! == expectedRFC2202) diff --git a/README.playground/section-13-original.swift b/README.playground/section-13-original.swift new file mode 100644 index 0000000..ddef305 --- /dev/null +++ b/README.playground/section-13-original.swift @@ -0,0 +1,11 @@ +var key = arrayFromHexString("2b7e151628aed2a6abf7158809cf4f3c") +var plainText = "The quick brown fox jumps over the lazy dog. The fox has more or less had it at this point." + +var cryptor = Cryptor(operation:.Encrypt, algorithm:.AES, options:.PKCS7Padding, key:key, iv:Array()) +var cipherText = cryptor.update(plainText)?.final() + +cryptor = Cryptor(operation:.Decrypt, algorithm:.AES, options:.PKCS7Padding, key:key, iv:Array()) +var decryptedPlainText = cryptor.update(cipherText!)?.final() +var decryptedString = decryptedPlainText!.reduce("") { $0 + String(UnicodeScalar($1)) } +decryptedString +assert(decryptedString == plainText) \ No newline at end of file diff --git a/README.playground/section-13.swift b/README.playground/section-13.swift index ddef305..262f79e 100644 --- a/README.playground/section-13.swift +++ b/README.playground/section-13.swift @@ -8,4 +8,4 @@ cryptor = Cryptor(operation:.Decrypt, algorithm:.AES, options:.PKCS7Padding, key var decryptedPlainText = cryptor.update(cipherText!)?.final() var decryptedString = decryptedPlainText!.reduce("") { $0 + String(UnicodeScalar($1)) } decryptedString -assert(decryptedString == plainText) \ No newline at end of file +assert(decryptedString == plainText) diff --git a/README.playground/section-15-original.swift b/README.playground/section-15-original.swift new file mode 100644 index 0000000..3d902aa --- /dev/null +++ b/README.playground/section-15-original.swift @@ -0,0 +1,51 @@ +func crypt(sc : StreamCryptor, inputStream: NSInputStream, outputStream: NSOutputStream, bufferSize: Int) +{ + var inputBuffer = Array(count:1024, repeatedValue:0) + var outputBuffer = Array(count:1024, repeatedValue:0) + inputStream.open() + outputStream.open() + + var cryptedBytes : UInt = 0 + while inputStream.hasBytesAvailable + { + let bytesRead = inputStream.read(&inputBuffer, maxLength: inputBuffer.count) + let status = sc.update(inputBuffer, byteCountIn: UInt(bytesRead), bufferOut: &outputBuffer, byteCapacityOut: UInt(outputBuffer.count), byteCountOut: &cryptedBytes) + assert(status == Status.Success) + if(cryptedBytes > 0) + { + let bytesWritten = outputStream.write(outputBuffer, maxLength: Int(cryptedBytes)) + assert(bytesWritten == Int(cryptedBytes)) + } + } + let status = sc.final(&outputBuffer, byteCapacityOut: UInt(outputBuffer.count), byteCountOut: &cryptedBytes) + assert(status == Status.Success) + if(cryptedBytes > 0) + { + let bytesWritten = outputStream.write(outputBuffer, maxLength: Int(cryptedBytes)) + assert(bytesWritten == Int(cryptedBytes)) + } + inputStream.close() + outputStream.close() +} + +let imagePath = NSBundle.mainBundle().pathForResource("Riscal", ofType:"jpg")! +let tmp = NSTemporaryDirectory() +let encryptedFilePath = tmp.stringByAppendingPathComponent("Riscal.xjpgx") +var decryptedFilePath = tmp.stringByAppendingPathComponent("RiscalDecrypted.jpg") + +var imageInputStream = NSInputStream(fileAtPath: imagePath) +var encryptedFileOutputStream = NSOutputStream(toFileAtPath: encryptedFilePath, append:false) +var encryptedFileInputStream = NSInputStream(fileAtPath: encryptedFilePath) +var decryptedFileOutputStream = NSOutputStream(toFileAtPath: decryptedFilePath, append:false) + +var sc = StreamCryptor(operation:.Encrypt, algorithm:.AES, options:.PKCS7Padding, key:key, iv:Array()) +crypt(sc, imageInputStream, encryptedFileOutputStream, 1024) + +// Uncomment this line to verify that the file is encrypted +//var encryptedImage = UIImage(contentsOfFile:encryptedFile) + +sc = StreamCryptor(operation:.Decrypt, algorithm:.AES, options:.PKCS7Padding, key:key, iv:Array()) +crypt(sc, encryptedFileInputStream, decryptedFileOutputStream, 1024) + +var image = UIImage(named:"Riscal.jpg") +var decryptedImage = UIImage(contentsOfFile:decryptedFilePath) \ No newline at end of file diff --git a/README.playground/section-15.swift b/README.playground/section-15.swift index 3d902aa..4dab1b1 100644 --- a/README.playground/section-15.swift +++ b/README.playground/section-15.swift @@ -5,11 +5,11 @@ func crypt(sc : StreamCryptor, inputStream: NSInputStream, outputStream: NSOutp inputStream.open() outputStream.open() - var cryptedBytes : UInt = 0 + var cryptedBytes : Int = 0 while inputStream.hasBytesAvailable { let bytesRead = inputStream.read(&inputBuffer, maxLength: inputBuffer.count) - let status = sc.update(inputBuffer, byteCountIn: UInt(bytesRead), bufferOut: &outputBuffer, byteCapacityOut: UInt(outputBuffer.count), byteCountOut: &cryptedBytes) + let status = sc.update(inputBuffer, byteCountIn: bytesRead, bufferOut: &outputBuffer, byteCapacityOut: outputBuffer.count, byteCountOut: &cryptedBytes) assert(status == Status.Success) if(cryptedBytes > 0) { @@ -17,7 +17,7 @@ func crypt(sc : StreamCryptor, inputStream: NSInputStream, outputStream: NSOutp assert(bytesWritten == Int(cryptedBytes)) } } - let status = sc.final(&outputBuffer, byteCapacityOut: UInt(outputBuffer.count), byteCountOut: &cryptedBytes) + let status = sc.final(&outputBuffer, byteCapacityOut: outputBuffer.count, byteCountOut: &cryptedBytes) assert(status == Status.Success) if(cryptedBytes > 0) { @@ -29,7 +29,7 @@ func crypt(sc : StreamCryptor, inputStream: NSInputStream, outputStream: NSOutp } let imagePath = NSBundle.mainBundle().pathForResource("Riscal", ofType:"jpg")! -let tmp = NSTemporaryDirectory() +let tmp = NSTemporaryDirectory() as NSString let encryptedFilePath = tmp.stringByAppendingPathComponent("Riscal.xjpgx") var decryptedFilePath = tmp.stringByAppendingPathComponent("RiscalDecrypted.jpg") @@ -39,13 +39,13 @@ var encryptedFileInputStream = NSInputStream(fileAtPath: encryptedFilePath) var decryptedFileOutputStream = NSOutputStream(toFileAtPath: decryptedFilePath, append:false) var sc = StreamCryptor(operation:.Encrypt, algorithm:.AES, options:.PKCS7Padding, key:key, iv:Array()) -crypt(sc, imageInputStream, encryptedFileOutputStream, 1024) +crypt(sc, inputStream: imageInputStream!, outputStream: encryptedFileOutputStream!, bufferSize: 1024) // Uncomment this line to verify that the file is encrypted //var encryptedImage = UIImage(contentsOfFile:encryptedFile) sc = StreamCryptor(operation:.Decrypt, algorithm:.AES, options:.PKCS7Padding, key:key, iv:Array()) -crypt(sc, encryptedFileInputStream, decryptedFileOutputStream, 1024) +crypt(sc, inputStream: encryptedFileInputStream!, outputStream: decryptedFileOutputStream!, bufferSize: 1024) -var image = UIImage(named:"Riscal.jpg") -var decryptedImage = UIImage(contentsOfFile:decryptedFilePath) \ No newline at end of file +var image = NSImage(named:"Riscal.jpg") +var decryptedImage = NSImage(contentsOfFile:decryptedFilePath) diff --git a/README.playground/section-17-original.swift b/README.playground/section-17-original.swift new file mode 100644 index 0000000..f4b9508 --- /dev/null +++ b/README.playground/section-17-original.swift @@ -0,0 +1,4 @@ +let keys6 = PBKDF.deriveKey("password", salt: "salt", prf: .SHA1, rounds: 1, derivedKeyLength: 20) +// RFC 6070 - Should derive 0c60c80f961f0e71f3a9b524af6012062fe037a6 +let expectedRFC6070 = arrayFromHexString("0c60c80f961f0e71f3a9b524af6012062fe037a6") +assert(keys6 == expectedRFC6070) \ No newline at end of file diff --git a/README.playground/section-17.swift b/README.playground/section-17.swift index f4b9508..b3fd482 100644 --- a/README.playground/section-17.swift +++ b/README.playground/section-17.swift @@ -1,4 +1,4 @@ let keys6 = PBKDF.deriveKey("password", salt: "salt", prf: .SHA1, rounds: 1, derivedKeyLength: 20) // RFC 6070 - Should derive 0c60c80f961f0e71f3a9b524af6012062fe037a6 let expectedRFC6070 = arrayFromHexString("0c60c80f961f0e71f3a9b524af6012062fe037a6") -assert(keys6 == expectedRFC6070) \ No newline at end of file +assert(keys6 == expectedRFC6070) diff --git a/README.playground/section-3-original.swift b/README.playground/section-3-original.swift new file mode 100644 index 0000000..4173357 --- /dev/null +++ b/README.playground/section-3-original.swift @@ -0,0 +1,9 @@ +let s = "The quick brown fox jumps over the lazy dog." +var md5s2 : Digest = Digest(algorithm:.MD5) +md5s2.update(s) +let digests2 = md5s2.final() + +// According to Wikipedia this should be +// e4d909c290d0fb1ca068ffaddf22cbd0 +hexStringFromArray(digests2) +assert(digests2 == arrayFromHexString("e4d909c290d0fb1ca068ffaddf22cbd0")) \ No newline at end of file diff --git a/README.playground/section-3.swift b/README.playground/section-3.swift index 4173357..fd7ea9c 100644 --- a/README.playground/section-3.swift +++ b/README.playground/section-3.swift @@ -6,4 +6,4 @@ let digests2 = md5s2.final() // According to Wikipedia this should be // e4d909c290d0fb1ca068ffaddf22cbd0 hexStringFromArray(digests2) -assert(digests2 == arrayFromHexString("e4d909c290d0fb1ca068ffaddf22cbd0")) \ No newline at end of file +assert(digests2 == arrayFromHexString("e4d909c290d0fb1ca068ffaddf22cbd0")) diff --git a/README.playground/section-5-original.swift b/README.playground/section-5-original.swift new file mode 100644 index 0000000..bd1ccc2 --- /dev/null +++ b/README.playground/section-5-original.swift @@ -0,0 +1,7 @@ +let b : [UInt8] = +[0x54,0x68,0x65,0x20,0x71,0x75,0x69,0x63, +0x6b,0x20,0x62,0x72,0x6f,0x77,0x6e,0x20, +0x66,0x6f,0x78,0x2e] +var md5s1 : Digest = Digest(algorithm:.MD5) +md5s1.update(b) +let digests1 = md5s1.final() \ No newline at end of file diff --git a/README.playground/section-5.swift b/README.playground/section-5.swift index bd1ccc2..71e1911 100644 --- a/README.playground/section-5.swift +++ b/README.playground/section-5.swift @@ -4,4 +4,4 @@ let b : [UInt8] = 0x66,0x6f,0x78,0x2e] var md5s1 : Digest = Digest(algorithm:.MD5) md5s1.update(b) -let digests1 = md5s1.final() \ No newline at end of file +let digests1 = md5s1.final() diff --git a/README.playground/section-7-original.swift b/README.playground/section-7-original.swift new file mode 100644 index 0000000..b86f095 --- /dev/null +++ b/README.playground/section-7-original.swift @@ -0,0 +1 @@ + var digests3 = Digest(algorithm: .MD5).update(b)?.final() // digest is of type [UInt8]? \ No newline at end of file diff --git a/README.playground/section-7.swift b/README.playground/section-7.swift index b86f095..095b039 100644 --- a/README.playground/section-7.swift +++ b/README.playground/section-7.swift @@ -1 +1 @@ - var digests3 = Digest(algorithm: .MD5).update(b)?.final() // digest is of type [UInt8]? \ No newline at end of file + var digests3 = Digest(algorithm: .MD5).update(b)?.final() // digest is of type [UInt8]? diff --git a/README.playground/section-9-original.swift b/README.playground/section-9-original.swift new file mode 100644 index 0000000..4ce6b9b --- /dev/null +++ b/README.playground/section-9-original.swift @@ -0,0 +1 @@ + var digests4 = Digest(algorithm: .MD5).update(s)?.final() // digest is of type [UInt8]? \ No newline at end of file diff --git a/README.playground/section-9.swift b/README.playground/section-9.swift index 4ce6b9b..80987e3 100644 --- a/README.playground/section-9.swift +++ b/README.playground/section-9.swift @@ -1 +1 @@ - var digests4 = Digest(algorithm: .MD5).update(s)?.final() // digest is of type [UInt8]? \ No newline at end of file + var digests4 = Digest(algorithm: .MD5).update(s)?.final() // digest is of type [UInt8]? diff --git a/README.playground/timeline.xctimeline b/README.playground/timeline.xctimeline new file mode 100644 index 0000000..bf468af --- /dev/null +++ b/README.playground/timeline.xctimeline @@ -0,0 +1,6 @@ + + + + +