├── .gitignore ├── CommonCrypto └── module.map ├── Mac.playground ├── contents.xcplayground ├── section-1.swift └── timeline.xctimeline ├── README.md ├── SHA256.swift ├── SHA256.xcodeproj ├── project.pbxproj └── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ └── SHA256.xccheckout ├── SHA256Tests.swift ├── SHA256iOs └── SHA256iOs.h ├── Supporting Files ├── Mac │ ├── SHA256-Info.plist │ └── SHA256Tests-Info.plist └── iOs │ ├── Info.plist │ └── SHA256Tests-Info.plist └── iOs.playground ├── contents.xcplayground ├── section-1.swift └── timeline.xctimeline /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | *.xcuserstate 3 | .DS_Store 4 | xcuserdata 5 | 6 | SHA256.xcodeproj/xcuserdata/sjors.xcuserdatad/xcschemes/xcschememanagement.plist 7 | 8 | SHA256.xcodeproj/xcuserdata/sjors.xcuserdatad/xcschemes/SHA256 Mac.xcscheme 9 | 10 | SHA256.xcodeproj/xcuserdata/sjors.xcuserdatad/xcschemes/SHA256 iOs.xcscheme 11 | -------------------------------------------------------------------------------- /CommonCrypto/module.map: -------------------------------------------------------------------------------- 1 | module CommonCrypto [system] { 2 | header "/usr/include/CommonCrypto/CommonCrypto.h" 3 | link "CommonCrypto" 4 | export * 5 | } 6 | -------------------------------------------------------------------------------- /Mac.playground/contents.xcplayground: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /Mac.playground/section-1.swift: -------------------------------------------------------------------------------- 1 | // Note: this currently doesn't work 2 | 3 | // To use this Playground select SHA256 Mac as the scheme and build. 4 | import CommonCrypto // "No such module "CommonCrypto" 5 | import SHA256Mac // "Missing required module 'CommonCrypto" 6 | 7 | let digest: String = SHA256.hexStringDigest("800C28FCA386C7A227600B2FE50B7CAE11EC86D3BF1FBE471BE89827E19D72AA1D") 8 | 9 | -------------------------------------------------------------------------------- /Mac.playground/timeline.xctimeline: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | SHA256-Swift 2 | ============ 3 | 4 | Swift framework wrapping CommonCrypto's SHA256 methods. 5 | 6 | *This is experimental. Do not use this in a production system.* 7 | 8 | Installation instructions 9 | ------------------------- 10 | 11 | 1. Add the SHA256-Swift project to your existing project either through a workspace or as a subproject. 12 | 1. Link the appropriate framework (either SHA256iOs or SHA256Mac). 13 | 1. Where required, `import SHA256iOs` 14 | 1. In your main project, add the path to the CommonCrypto module directory to your Swift import paths. `${SRCROOT}/SHA256-Swift/CommonCrypto` for example. 15 | 16 | -------------------------------------------------------------------------------- /SHA256.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SHA256.swift 3 | // CryptoCoin 4 | // 5 | // Created by Sjors Provoost on 07-07-14. 6 | // 7 | // Swift wrapper for CCHmac 8 | 9 | import Foundation 10 | import CommonCrypto 11 | 12 | public struct SHA256 { 13 | public static func digest (input : NSData) -> NSData { 14 | let digestLength = HMACAlgorithm.SHA256.digestLength() 15 | 16 | var hash = [UInt8](count: digestLength, repeatedValue: 0) 17 | 18 | CC_SHA256(input.bytes, UInt32(input.length), &hash) 19 | 20 | return NSData(bytes: hash, length: digestLength) 21 | } 22 | 23 | // Takes a string representation of a hexadecimal number 24 | public static func hexStringDigest (input : String) -> NSData { 25 | let data = SHA256.dataFromHexString(input) 26 | return digest(data) 27 | } 28 | 29 | // Returns a string representation of a hexadecimal number 30 | public static func hexStringDigest (input : NSData) -> String { 31 | return hexStringFromData(digest(input)) 32 | } 33 | 34 | 35 | // Takes a string representation of a hexadecimal number and returns a 36 | // string represenation of the resulting 256 bit hash. 37 | public static func hexStringDigest (input : String) -> String { 38 | let digest: NSData = hexStringDigest(input) 39 | return hexStringFromData(digest) 40 | } 41 | 42 | public static func dataFromHexString(input: String) -> NSData { 43 | // Based on: http://stackoverflow.com/a/2505561/313633 44 | var data = NSMutableData() 45 | 46 | var string = "" 47 | 48 | for char in input { 49 | string.append(char) 50 | if(count(string) == 2) { 51 | let scanner = NSScanner(string: string) 52 | var value: CUnsignedInt = 0 53 | scanner.scanHexInt(&value) 54 | data.appendBytes(&value, length: 1) 55 | string = "" 56 | } 57 | 58 | } 59 | 60 | return data as NSData 61 | } 62 | 63 | public static func hexStringFromData(input: NSData) -> String { 64 | let sha256description = input.description as String 65 | 66 | // TODO: more elegant way to convert NSData to a hex string 67 | 68 | var result: String = "" 69 | 70 | for char in sha256description { 71 | switch char { 72 | case "0", "1", "2", "3", "4", "5", "6", "7","8","9", "a", "b", "c", "d", "e", "f": 73 | result.append(char) 74 | default: 75 | result += "" 76 | } 77 | } 78 | 79 | return result 80 | } 81 | 82 | 83 | } 84 | 85 | // http://stackoverflow.com/a/24411522/313633 86 | 87 | enum HMACAlgorithm { 88 | case MD5, SHA1, SHA224, SHA256, SHA384, SHA512 89 | 90 | func toCCEnum() -> CCHmacAlgorithm { 91 | var result: Int = 0 92 | switch self { 93 | case .MD5: 94 | result = kCCHmacAlgMD5 95 | case .SHA1: 96 | result = kCCHmacAlgSHA1 97 | case .SHA224: 98 | result = kCCHmacAlgSHA224 99 | case .SHA256: 100 | result = kCCHmacAlgSHA256 101 | case .SHA384: 102 | result = kCCHmacAlgSHA384 103 | case .SHA512: 104 | result = kCCHmacAlgSHA512 105 | } 106 | return CCHmacAlgorithm(result) 107 | } 108 | 109 | func digestLength() -> Int { 110 | var result: CInt = 0 111 | switch self { 112 | case .MD5: 113 | result = CC_MD5_DIGEST_LENGTH 114 | case .SHA1: 115 | result = CC_SHA1_DIGEST_LENGTH 116 | case .SHA224: 117 | result = CC_SHA224_DIGEST_LENGTH 118 | case .SHA256: 119 | result = CC_SHA256_DIGEST_LENGTH 120 | case .SHA384: 121 | result = CC_SHA384_DIGEST_LENGTH 122 | case .SHA512: 123 | result = CC_SHA512_DIGEST_LENGTH 124 | } 125 | return Int(result) 126 | } 127 | } -------------------------------------------------------------------------------- /SHA256.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | A2230F78197E883B003C178C /* SHA256.swift in Sources */ = {isa = PBXBuildFile; fileRef = A2230F77197E883B003C178C /* SHA256.swift */; }; 11 | A2230F7F197E8914003C178C /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A2230F7E197E8914003C178C /* SystemConfiguration.framework */; }; 12 | A22C2B91198E656400B48868 /* SHA256iOs.h in Headers */ = {isa = PBXBuildFile; fileRef = A22C2B90198E656400B48868 /* SHA256iOs.h */; settings = {ATTRIBUTES = (Public, ); }; }; 13 | A22C2B93198E658900B48868 /* SHA256Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A22C2B92198E658900B48868 /* SHA256Tests.swift */; }; 14 | A2D88907198D886000D57AD2 /* SHA256.swift in Sources */ = {isa = PBXBuildFile; fileRef = A2230F77197E883B003C178C /* SHA256.swift */; }; 15 | A2D8890F198D8AAF00D57AD2 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A2D88908198D889100D57AD2 /* SystemConfiguration.framework */; }; 16 | A2FD6A3C197E8757006FA7EF /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A2FD6A3B197E8757006FA7EF /* Cocoa.framework */; }; 17 | A2FD6A51197E8757006FA7EF /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A2FD6A50197E8757006FA7EF /* XCTest.framework */; }; 18 | A2FD6A52197E8757006FA7EF /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A2FD6A3B197E8757006FA7EF /* Cocoa.framework */; }; 19 | A2FD6A55197E8757006FA7EF /* SHA256Mac.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A2FD6A38197E8757006FA7EF /* SHA256Mac.framework */; }; 20 | A2FDB89C19C07A2000BC4740 /* SHA256Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A22C2B92198E658900B48868 /* SHA256Tests.swift */; }; 21 | /* End PBXBuildFile section */ 22 | 23 | /* Begin PBXContainerItemProxy section */ 24 | A2230F80197E8924003C178C /* PBXContainerItemProxy */ = { 25 | isa = PBXContainerItemProxy; 26 | containerPortal = A2FD6A2F197E8757006FA7EF /* Project object */; 27 | proxyType = 1; 28 | remoteGlobalIDString = A2FD6A37197E8757006FA7EF; 29 | remoteInfo = SHA256; 30 | }; 31 | A2230F82197E8924003C178C /* PBXContainerItemProxy */ = { 32 | isa = PBXContainerItemProxy; 33 | containerPortal = A2FD6A2F197E8757006FA7EF /* Project object */; 34 | proxyType = 1; 35 | remoteGlobalIDString = A2FD6A37197E8757006FA7EF; 36 | remoteInfo = SHA256; 37 | }; 38 | A2FD6A53197E8757006FA7EF /* PBXContainerItemProxy */ = { 39 | isa = PBXContainerItemProxy; 40 | containerPortal = A2FD6A2F197E8757006FA7EF /* Project object */; 41 | proxyType = 1; 42 | remoteGlobalIDString = A2FD6A37197E8757006FA7EF; 43 | remoteInfo = SHA256; 44 | }; 45 | /* End PBXContainerItemProxy section */ 46 | 47 | /* Begin PBXFileReference section */ 48 | A2230F77197E883B003C178C /* SHA256.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SHA256.swift; sourceTree = ""; }; 49 | A2230F7C197E88F3003C178C /* libcommonCrypto.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libcommonCrypto.dylib; path = usr/lib/system/libcommonCrypto.dylib; sourceTree = SDKROOT; }; 50 | A2230F7E197E8914003C178C /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; }; 51 | A22C2B90198E656400B48868 /* SHA256iOs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SHA256iOs.h; path = SHA256iOs/SHA256iOs.h; sourceTree = SOURCE_ROOT; }; 52 | A22C2B92198E658900B48868 /* SHA256Tests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SHA256Tests.swift; sourceTree = SOURCE_ROOT; }; 53 | A23208D21996473200BF5E38 /* Mac.playground */ = {isa = PBXFileReference; lastKnownFileType = file.playground; path = Mac.playground; sourceTree = ""; }; 54 | A2D39BE1198D841400E2D317 /* SHA256iOs.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SHA256iOs.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 55 | A2D39BE4198D841400E2D317 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; name = Info.plist; path = "Supporting Files/iOs/Info.plist"; sourceTree = ""; }; 56 | A2D88908198D889100D57AD2 /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.0.sdk/System/Library/Frameworks/SystemConfiguration.framework; sourceTree = DEVELOPER_DIR; }; 57 | A2D8890A198D89E500D57AD2 /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.0.sdk/System/Library/Frameworks/JavaScriptCore.framework; sourceTree = DEVELOPER_DIR; }; 58 | A2D8890C198D8A4000D57AD2 /* libcommonCrypto.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libcommonCrypto.dylib; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.0.sdk/usr/lib/system/libcommonCrypto.dylib; sourceTree = DEVELOPER_DIR; }; 59 | A2FD6A38197E8757006FA7EF /* SHA256Mac.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SHA256Mac.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 60 | A2FD6A3B197E8757006FA7EF /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; }; 61 | A2FD6A3E197E8757006FA7EF /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 62 | A2FD6A3F197E8757006FA7EF /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = System/Library/Frameworks/CoreData.framework; sourceTree = SDKROOT; }; 63 | A2FD6A40197E8757006FA7EF /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; }; 64 | A2FD6A43197E8757006FA7EF /* SHA256-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; name = "SHA256-Info.plist"; path = "Supporting Files/Mac/SHA256-Info.plist"; sourceTree = ""; }; 65 | A2FD6A4F197E8757006FA7EF /* SHA256Mac Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "SHA256Mac Tests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; 66 | A2FD6A50197E8757006FA7EF /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; 67 | A2FD6A58197E8757006FA7EF /* SHA256Tests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = "SHA256Tests-Info.plist"; path = "Supporting Files/Mac/SHA256Tests-Info.plist"; sourceTree = SOURCE_ROOT; }; 68 | A2FDB88C19C0792100BC4740 /* iOs.playground */ = {isa = PBXFileReference; lastKnownFileType = file.playground; path = iOs.playground; sourceTree = ""; }; 69 | A2FDB89119C079EE00BC4740 /* SHA256iOs Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "SHA256iOs Tests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; 70 | A2FDB89419C079EE00BC4740 /* SHA256Tests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = "SHA256Tests-Info.plist"; path = "Supporting Files/iOs/SHA256Tests-Info.plist"; sourceTree = SOURCE_ROOT; }; 71 | /* End PBXFileReference section */ 72 | 73 | /* Begin PBXFrameworksBuildPhase section */ 74 | A2D39BDD198D841400E2D317 /* Frameworks */ = { 75 | isa = PBXFrameworksBuildPhase; 76 | buildActionMask = 2147483647; 77 | files = ( 78 | A2D8890F198D8AAF00D57AD2 /* SystemConfiguration.framework in Frameworks */, 79 | ); 80 | runOnlyForDeploymentPostprocessing = 0; 81 | }; 82 | A2FD6A34197E8757006FA7EF /* Frameworks */ = { 83 | isa = PBXFrameworksBuildPhase; 84 | buildActionMask = 2147483647; 85 | files = ( 86 | A2230F7F197E8914003C178C /* SystemConfiguration.framework in Frameworks */, 87 | A2FD6A3C197E8757006FA7EF /* Cocoa.framework in Frameworks */, 88 | ); 89 | runOnlyForDeploymentPostprocessing = 0; 90 | }; 91 | A2FD6A4C197E8757006FA7EF /* Frameworks */ = { 92 | isa = PBXFrameworksBuildPhase; 93 | buildActionMask = 2147483647; 94 | files = ( 95 | A2FD6A55197E8757006FA7EF /* SHA256Mac.framework in Frameworks */, 96 | A2FD6A52197E8757006FA7EF /* Cocoa.framework in Frameworks */, 97 | A2FD6A51197E8757006FA7EF /* XCTest.framework in Frameworks */, 98 | ); 99 | runOnlyForDeploymentPostprocessing = 0; 100 | }; 101 | A2FDB88E19C079EE00BC4740 /* Frameworks */ = { 102 | isa = PBXFrameworksBuildPhase; 103 | buildActionMask = 2147483647; 104 | files = ( 105 | ); 106 | runOnlyForDeploymentPostprocessing = 0; 107 | }; 108 | /* End PBXFrameworksBuildPhase section */ 109 | 110 | /* Begin PBXGroup section */ 111 | A2230F75197E87E2003C178C /* Mac */ = { 112 | isa = PBXGroup; 113 | children = ( 114 | A2FD6A43197E8757006FA7EF /* SHA256-Info.plist */, 115 | ); 116 | name = Mac; 117 | sourceTree = ""; 118 | }; 119 | A2230F76197E87E9003C178C /* MacTests */ = { 120 | isa = PBXGroup; 121 | children = ( 122 | A2FD6A58197E8757006FA7EF /* SHA256Tests-Info.plist */, 123 | ); 124 | name = MacTests; 125 | sourceTree = ""; 126 | }; 127 | A2230F79197E8840003C178C /* Classes */ = { 128 | isa = PBXGroup; 129 | children = ( 130 | A2230F77197E883B003C178C /* SHA256.swift */, 131 | ); 132 | name = Classes; 133 | sourceTree = ""; 134 | }; 135 | A2D39BFC198D84D700E2D317 /* iOs */ = { 136 | isa = PBXGroup; 137 | children = ( 138 | A2D39BE4198D841400E2D317 /* Info.plist */, 139 | ); 140 | name = iOs; 141 | sourceTree = ""; 142 | }; 143 | A2FD6A2E197E8757006FA7EF = { 144 | isa = PBXGroup; 145 | children = ( 146 | A23208D21996473200BF5E38 /* Mac.playground */, 147 | A2FDB88C19C0792100BC4740 /* iOs.playground */, 148 | A2230F79197E8840003C178C /* Classes */, 149 | A2FD6A56197E8757006FA7EF /* Tests */, 150 | A2FD6A42197E8757006FA7EF /* Supporting Files */, 151 | A2FD6A3A197E8757006FA7EF /* Frameworks */, 152 | A2FD6A39197E8757006FA7EF /* Products */, 153 | ); 154 | sourceTree = ""; 155 | }; 156 | A2FD6A39197E8757006FA7EF /* Products */ = { 157 | isa = PBXGroup; 158 | children = ( 159 | A2FD6A38197E8757006FA7EF /* SHA256Mac.framework */, 160 | A2FD6A4F197E8757006FA7EF /* SHA256Mac Tests.xctest */, 161 | A2D39BE1198D841400E2D317 /* SHA256iOs.framework */, 162 | A2FDB89119C079EE00BC4740 /* SHA256iOs Tests.xctest */, 163 | ); 164 | name = Products; 165 | sourceTree = ""; 166 | }; 167 | A2FD6A3A197E8757006FA7EF /* Frameworks */ = { 168 | isa = PBXGroup; 169 | children = ( 170 | A2D8890C198D8A4000D57AD2 /* libcommonCrypto.dylib */, 171 | A2D8890A198D89E500D57AD2 /* JavaScriptCore.framework */, 172 | A2D88908198D889100D57AD2 /* SystemConfiguration.framework */, 173 | A2230F7E197E8914003C178C /* SystemConfiguration.framework */, 174 | A2230F7C197E88F3003C178C /* libcommonCrypto.dylib */, 175 | A2FD6A3B197E8757006FA7EF /* Cocoa.framework */, 176 | A2FD6A50197E8757006FA7EF /* XCTest.framework */, 177 | A2FD6A3D197E8757006FA7EF /* Other Frameworks */, 178 | ); 179 | name = Frameworks; 180 | sourceTree = ""; 181 | }; 182 | A2FD6A3D197E8757006FA7EF /* Other Frameworks */ = { 183 | isa = PBXGroup; 184 | children = ( 185 | A2FD6A3E197E8757006FA7EF /* Foundation.framework */, 186 | A2FD6A3F197E8757006FA7EF /* CoreData.framework */, 187 | A2FD6A40197E8757006FA7EF /* AppKit.framework */, 188 | ); 189 | name = "Other Frameworks"; 190 | sourceTree = ""; 191 | }; 192 | A2FD6A42197E8757006FA7EF /* Supporting Files */ = { 193 | isa = PBXGroup; 194 | children = ( 195 | A2FDB89B19C079FB00BC4740 /* iOs Tests */, 196 | A22C2B90198E656400B48868 /* SHA256iOs.h */, 197 | A2230F75197E87E2003C178C /* Mac */, 198 | A2D39BFC198D84D700E2D317 /* iOs */, 199 | A2230F76197E87E9003C178C /* MacTests */, 200 | ); 201 | name = "Supporting Files"; 202 | path = SHA256; 203 | sourceTree = ""; 204 | }; 205 | A2FD6A56197E8757006FA7EF /* Tests */ = { 206 | isa = PBXGroup; 207 | children = ( 208 | A22C2B92198E658900B48868 /* SHA256Tests.swift */, 209 | ); 210 | name = Tests; 211 | path = SHA256Tests; 212 | sourceTree = ""; 213 | }; 214 | A2FDB89B19C079FB00BC4740 /* iOs Tests */ = { 215 | isa = PBXGroup; 216 | children = ( 217 | A2FDB89419C079EE00BC4740 /* SHA256Tests-Info.plist */, 218 | ); 219 | name = "iOs Tests"; 220 | sourceTree = ""; 221 | }; 222 | /* End PBXGroup section */ 223 | 224 | /* Begin PBXHeadersBuildPhase section */ 225 | A2D39BDE198D841400E2D317 /* Headers */ = { 226 | isa = PBXHeadersBuildPhase; 227 | buildActionMask = 2147483647; 228 | files = ( 229 | A22C2B91198E656400B48868 /* SHA256iOs.h in Headers */, 230 | ); 231 | runOnlyForDeploymentPostprocessing = 0; 232 | }; 233 | A2FD6A35197E8757006FA7EF /* Headers */ = { 234 | isa = PBXHeadersBuildPhase; 235 | buildActionMask = 2147483647; 236 | files = ( 237 | ); 238 | runOnlyForDeploymentPostprocessing = 0; 239 | }; 240 | /* End PBXHeadersBuildPhase section */ 241 | 242 | /* Begin PBXNativeTarget section */ 243 | A2D39BE0198D841400E2D317 /* SHA256iOs */ = { 244 | isa = PBXNativeTarget; 245 | buildConfigurationList = A2D39BF4198D841500E2D317 /* Build configuration list for PBXNativeTarget "SHA256iOs" */; 246 | buildPhases = ( 247 | A2D39BDC198D841400E2D317 /* Sources */, 248 | A2D39BDD198D841400E2D317 /* Frameworks */, 249 | A2D39BDE198D841400E2D317 /* Headers */, 250 | A2D39BDF198D841400E2D317 /* Resources */, 251 | ); 252 | buildRules = ( 253 | ); 254 | dependencies = ( 255 | ); 256 | name = SHA256iOs; 257 | productName = SHA256; 258 | productReference = A2D39BE1198D841400E2D317 /* SHA256iOs.framework */; 259 | productType = "com.apple.product-type.framework"; 260 | }; 261 | A2FD6A37197E8757006FA7EF /* SHA256Mac */ = { 262 | isa = PBXNativeTarget; 263 | buildConfigurationList = A2FD6A60197E8757006FA7EF /* Build configuration list for PBXNativeTarget "SHA256Mac" */; 264 | buildPhases = ( 265 | A2FD6A33197E8757006FA7EF /* Sources */, 266 | A2FD6A34197E8757006FA7EF /* Frameworks */, 267 | A2FD6A35197E8757006FA7EF /* Headers */, 268 | A2FD6A36197E8757006FA7EF /* Resources */, 269 | ); 270 | buildRules = ( 271 | ); 272 | dependencies = ( 273 | ); 274 | name = SHA256Mac; 275 | productName = SHA256; 276 | productReference = A2FD6A38197E8757006FA7EF /* SHA256Mac.framework */; 277 | productType = "com.apple.product-type.framework"; 278 | }; 279 | A2FD6A4E197E8757006FA7EF /* SHA256Mac Tests */ = { 280 | isa = PBXNativeTarget; 281 | buildConfigurationList = A2FD6A63197E8757006FA7EF /* Build configuration list for PBXNativeTarget "SHA256Mac Tests" */; 282 | buildPhases = ( 283 | A2FD6A4B197E8757006FA7EF /* Sources */, 284 | A2FD6A4C197E8757006FA7EF /* Frameworks */, 285 | A2FD6A4D197E8757006FA7EF /* Resources */, 286 | ); 287 | buildRules = ( 288 | ); 289 | dependencies = ( 290 | A2FD6A54197E8757006FA7EF /* PBXTargetDependency */, 291 | A2230F81197E8924003C178C /* PBXTargetDependency */, 292 | A2230F83197E8924003C178C /* PBXTargetDependency */, 293 | ); 294 | name = "SHA256Mac Tests"; 295 | productName = SHA256Tests; 296 | productReference = A2FD6A4F197E8757006FA7EF /* SHA256Mac Tests.xctest */; 297 | productType = "com.apple.product-type.bundle.unit-test"; 298 | }; 299 | A2FDB89019C079EE00BC4740 /* SHA256iOs Tests */ = { 300 | isa = PBXNativeTarget; 301 | buildConfigurationList = A2FDB89719C079EE00BC4740 /* Build configuration list for PBXNativeTarget "SHA256iOs Tests" */; 302 | buildPhases = ( 303 | A2FDB88D19C079EE00BC4740 /* Sources */, 304 | A2FDB88E19C079EE00BC4740 /* Frameworks */, 305 | A2FDB88F19C079EE00BC4740 /* Resources */, 306 | ); 307 | buildRules = ( 308 | ); 309 | dependencies = ( 310 | ); 311 | name = "SHA256iOs Tests"; 312 | productName = "SHA256iOs Tests"; 313 | productReference = A2FDB89119C079EE00BC4740 /* SHA256iOs Tests.xctest */; 314 | productType = "com.apple.product-type.bundle.unit-test"; 315 | }; 316 | /* End PBXNativeTarget section */ 317 | 318 | /* Begin PBXProject section */ 319 | A2FD6A2F197E8757006FA7EF /* Project object */ = { 320 | isa = PBXProject; 321 | attributes = { 322 | LastUpgradeCheck = 0600; 323 | ORGANIZATIONNAME = "Crypto Coin Swift"; 324 | TargetAttributes = { 325 | A2D39BE0198D841400E2D317 = { 326 | CreatedOnToolsVersion = 6.0; 327 | }; 328 | A2FD6A4E197E8757006FA7EF = { 329 | TestTargetID = A2FD6A37197E8757006FA7EF; 330 | }; 331 | A2FDB89019C079EE00BC4740 = { 332 | CreatedOnToolsVersion = 6.0; 333 | }; 334 | }; 335 | }; 336 | buildConfigurationList = A2FD6A32197E8757006FA7EF /* Build configuration list for PBXProject "SHA256" */; 337 | compatibilityVersion = "Xcode 3.2"; 338 | developmentRegion = English; 339 | hasScannedForEncodings = 0; 340 | knownRegions = ( 341 | en, 342 | ); 343 | mainGroup = A2FD6A2E197E8757006FA7EF; 344 | productRefGroup = A2FD6A39197E8757006FA7EF /* Products */; 345 | projectDirPath = ""; 346 | projectRoot = ""; 347 | targets = ( 348 | A2FD6A37197E8757006FA7EF /* SHA256Mac */, 349 | A2FD6A4E197E8757006FA7EF /* SHA256Mac Tests */, 350 | A2D39BE0198D841400E2D317 /* SHA256iOs */, 351 | A2FDB89019C079EE00BC4740 /* SHA256iOs Tests */, 352 | ); 353 | }; 354 | /* End PBXProject section */ 355 | 356 | /* Begin PBXResourcesBuildPhase section */ 357 | A2D39BDF198D841400E2D317 /* Resources */ = { 358 | isa = PBXResourcesBuildPhase; 359 | buildActionMask = 2147483647; 360 | files = ( 361 | ); 362 | runOnlyForDeploymentPostprocessing = 0; 363 | }; 364 | A2FD6A36197E8757006FA7EF /* Resources */ = { 365 | isa = PBXResourcesBuildPhase; 366 | buildActionMask = 2147483647; 367 | files = ( 368 | ); 369 | runOnlyForDeploymentPostprocessing = 0; 370 | }; 371 | A2FD6A4D197E8757006FA7EF /* Resources */ = { 372 | isa = PBXResourcesBuildPhase; 373 | buildActionMask = 2147483647; 374 | files = ( 375 | ); 376 | runOnlyForDeploymentPostprocessing = 0; 377 | }; 378 | A2FDB88F19C079EE00BC4740 /* Resources */ = { 379 | isa = PBXResourcesBuildPhase; 380 | buildActionMask = 2147483647; 381 | files = ( 382 | ); 383 | runOnlyForDeploymentPostprocessing = 0; 384 | }; 385 | /* End PBXResourcesBuildPhase section */ 386 | 387 | /* Begin PBXSourcesBuildPhase section */ 388 | A2D39BDC198D841400E2D317 /* Sources */ = { 389 | isa = PBXSourcesBuildPhase; 390 | buildActionMask = 2147483647; 391 | files = ( 392 | A2D88907198D886000D57AD2 /* SHA256.swift in Sources */, 393 | ); 394 | runOnlyForDeploymentPostprocessing = 0; 395 | }; 396 | A2FD6A33197E8757006FA7EF /* Sources */ = { 397 | isa = PBXSourcesBuildPhase; 398 | buildActionMask = 2147483647; 399 | files = ( 400 | A2230F78197E883B003C178C /* SHA256.swift in Sources */, 401 | ); 402 | runOnlyForDeploymentPostprocessing = 0; 403 | }; 404 | A2FD6A4B197E8757006FA7EF /* Sources */ = { 405 | isa = PBXSourcesBuildPhase; 406 | buildActionMask = 2147483647; 407 | files = ( 408 | A22C2B93198E658900B48868 /* SHA256Tests.swift in Sources */, 409 | ); 410 | runOnlyForDeploymentPostprocessing = 0; 411 | }; 412 | A2FDB88D19C079EE00BC4740 /* Sources */ = { 413 | isa = PBXSourcesBuildPhase; 414 | buildActionMask = 2147483647; 415 | files = ( 416 | A2FDB89C19C07A2000BC4740 /* SHA256Tests.swift in Sources */, 417 | ); 418 | runOnlyForDeploymentPostprocessing = 0; 419 | }; 420 | /* End PBXSourcesBuildPhase section */ 421 | 422 | /* Begin PBXTargetDependency section */ 423 | A2230F81197E8924003C178C /* PBXTargetDependency */ = { 424 | isa = PBXTargetDependency; 425 | target = A2FD6A37197E8757006FA7EF /* SHA256Mac */; 426 | targetProxy = A2230F80197E8924003C178C /* PBXContainerItemProxy */; 427 | }; 428 | A2230F83197E8924003C178C /* PBXTargetDependency */ = { 429 | isa = PBXTargetDependency; 430 | target = A2FD6A37197E8757006FA7EF /* SHA256Mac */; 431 | targetProxy = A2230F82197E8924003C178C /* PBXContainerItemProxy */; 432 | }; 433 | A2FD6A54197E8757006FA7EF /* PBXTargetDependency */ = { 434 | isa = PBXTargetDependency; 435 | target = A2FD6A37197E8757006FA7EF /* SHA256Mac */; 436 | targetProxy = A2FD6A53197E8757006FA7EF /* PBXContainerItemProxy */; 437 | }; 438 | /* End PBXTargetDependency section */ 439 | 440 | /* Begin XCBuildConfiguration section */ 441 | A2230F84197E89B1003C178C /* Fast */ = { 442 | isa = XCBuildConfiguration; 443 | buildSettings = { 444 | ALWAYS_SEARCH_USER_PATHS = NO; 445 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 446 | CLANG_CXX_LIBRARY = "libc++"; 447 | CLANG_ENABLE_MODULES = YES; 448 | CLANG_ENABLE_OBJC_ARC = YES; 449 | CLANG_WARN_BOOL_CONVERSION = YES; 450 | CLANG_WARN_CONSTANT_CONVERSION = YES; 451 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 452 | CLANG_WARN_EMPTY_BODY = YES; 453 | CLANG_WARN_ENUM_CONVERSION = YES; 454 | CLANG_WARN_INT_CONVERSION = YES; 455 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 456 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 457 | COPY_PHASE_STRIP = YES; 458 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 459 | ENABLE_NS_ASSERTIONS = NO; 460 | GCC_C_LANGUAGE_STANDARD = gnu99; 461 | GCC_ENABLE_OBJC_EXCEPTIONS = YES; 462 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 463 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 464 | GCC_WARN_UNDECLARED_SELECTOR = YES; 465 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 466 | GCC_WARN_UNUSED_FUNCTION = YES; 467 | GCC_WARN_UNUSED_VARIABLE = YES; 468 | MACOSX_DEPLOYMENT_TARGET = 10.9; 469 | SDKROOT = macosx; 470 | }; 471 | name = Fast; 472 | }; 473 | A2230F85197E89B1003C178C /* Fast */ = { 474 | isa = XCBuildConfiguration; 475 | buildSettings = { 476 | CLANG_ENABLE_MODULES = YES; 477 | COMBINE_HIDPI_IMAGES = YES; 478 | DEFINES_MODULE = YES; 479 | DYLIB_COMPATIBILITY_VERSION = 1; 480 | DYLIB_CURRENT_VERSION = 1; 481 | FRAMEWORK_VERSION = A; 482 | GCC_OPTIMIZATION_LEVEL = fast; 483 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 484 | GCC_PREFIX_HEADER = "SHA256/SHA256-Prefix.pch"; 485 | INFOPLIST_FILE = "Supporting Files/Mac/SHA256-Info.plist"; 486 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; 487 | LIBRARY_SEARCH_PATHS = ( 488 | "$(inherited)", 489 | "$(SDKROOT)/usr/lib/system", 490 | ); 491 | PRODUCT_NAME = SHA256Mac; 492 | SWIFT_INCLUDE_PATHS = CommonCrypto; 493 | SWIFT_OPTIMIZATION_LEVEL = "-Ounchecked"; 494 | WRAPPER_EXTENSION = framework; 495 | }; 496 | name = Fast; 497 | }; 498 | A2230F86197E89B1003C178C /* Fast */ = { 499 | isa = XCBuildConfiguration; 500 | buildSettings = { 501 | CLANG_ENABLE_MODULES = YES; 502 | COMBINE_HIDPI_IMAGES = YES; 503 | FRAMEWORK_SEARCH_PATHS = ( 504 | "$(DEVELOPER_FRAMEWORKS_DIR)", 505 | "$(inherited)", 506 | ); 507 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 508 | GCC_PREFIX_HEADER = "SHA256/SHA256-Prefix.pch"; 509 | INFOPLIST_FILE = "Supporting files/Mac/SHA256Tests-Info.plist"; 510 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; 511 | PRODUCT_NAME = "$(TARGET_NAME)"; 512 | SWIFT_INCLUDE_PATHS = CommonCrypto; 513 | WRAPPER_EXTENSION = xctest; 514 | }; 515 | name = Fast; 516 | }; 517 | A2D39BF5198D841500E2D317 /* Debug */ = { 518 | isa = XCBuildConfiguration; 519 | buildSettings = { 520 | CLANG_WARN_UNREACHABLE_CODE = YES; 521 | CODE_SIGN_IDENTITY = ""; 522 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; 523 | CURRENT_PROJECT_VERSION = 1; 524 | DEFINES_MODULE = YES; 525 | DYLIB_COMPATIBILITY_VERSION = 1; 526 | DYLIB_CURRENT_VERSION = 1; 527 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 528 | ENABLE_STRICT_OBJC_MSGSEND = YES; 529 | GCC_PREPROCESSOR_DEFINITIONS = ( 530 | "DEBUG=1", 531 | "$(inherited)", 532 | ); 533 | INFOPLIST_FILE = "Supporting Files/iOs/Info.plist"; 534 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 535 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 536 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 537 | LIBRARY_SEARCH_PATHS = ( 538 | "$(inherited)", 539 | "$(SDKROOT)/usr/lib/system", 540 | ); 541 | MTL_ENABLE_DEBUG_INFO = YES; 542 | PRODUCT_NAME = "$(TARGET_NAME)"; 543 | PROVISIONING_PROFILE = "3FE6B72E-A1FD-4A71-969A-1F8E9CD1BE4F"; 544 | SDKROOT = iphoneos; 545 | SKIP_INSTALL = YES; 546 | SWIFT_INCLUDE_PATHS = CommonCrypto; 547 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 548 | TARGETED_DEVICE_FAMILY = "1,2"; 549 | VERSIONING_SYSTEM = "apple-generic"; 550 | VERSION_INFO_PREFIX = ""; 551 | }; 552 | name = Debug; 553 | }; 554 | A2D39BF6198D841500E2D317 /* Release */ = { 555 | isa = XCBuildConfiguration; 556 | buildSettings = { 557 | CLANG_WARN_UNREACHABLE_CODE = YES; 558 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 559 | CURRENT_PROJECT_VERSION = 1; 560 | DEFINES_MODULE = YES; 561 | DYLIB_COMPATIBILITY_VERSION = 1; 562 | DYLIB_CURRENT_VERSION = 1; 563 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 564 | ENABLE_STRICT_OBJC_MSGSEND = YES; 565 | INFOPLIST_FILE = "Supporting Files/iOs/Info.plist"; 566 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 567 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 568 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 569 | LIBRARY_SEARCH_PATHS = ( 570 | "$(inherited)", 571 | "$(SDKROOT)/usr/lib/system", 572 | ); 573 | MTL_ENABLE_DEBUG_INFO = NO; 574 | PRODUCT_NAME = "$(TARGET_NAME)"; 575 | PROVISIONING_PROFILE = "3FE6B72E-A1FD-4A71-969A-1F8E9CD1BE4F"; 576 | SDKROOT = iphoneos; 577 | SKIP_INSTALL = YES; 578 | SWIFT_INCLUDE_PATHS = CommonCrypto; 579 | TARGETED_DEVICE_FAMILY = "1,2"; 580 | VALIDATE_PRODUCT = YES; 581 | VERSIONING_SYSTEM = "apple-generic"; 582 | VERSION_INFO_PREFIX = ""; 583 | }; 584 | name = Release; 585 | }; 586 | A2D39BF7198D841500E2D317 /* Fast */ = { 587 | isa = XCBuildConfiguration; 588 | buildSettings = { 589 | CLANG_WARN_UNREACHABLE_CODE = YES; 590 | CODE_SIGN_IDENTITY = ""; 591 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; 592 | CURRENT_PROJECT_VERSION = 1; 593 | DEFINES_MODULE = YES; 594 | DYLIB_COMPATIBILITY_VERSION = 1; 595 | DYLIB_CURRENT_VERSION = 1; 596 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 597 | ENABLE_STRICT_OBJC_MSGSEND = YES; 598 | INFOPLIST_FILE = "Supporting Files/iOs/Info.plist"; 599 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 600 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 601 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 602 | LIBRARY_SEARCH_PATHS = ( 603 | "$(inherited)", 604 | "$(SDKROOT)/usr/lib/system", 605 | ); 606 | MTL_ENABLE_DEBUG_INFO = NO; 607 | PRODUCT_NAME = "$(TARGET_NAME)"; 608 | PROVISIONING_PROFILE = "3FE6B72E-A1FD-4A71-969A-1F8E9CD1BE4F"; 609 | SDKROOT = iphoneos; 610 | SKIP_INSTALL = YES; 611 | SWIFT_INCLUDE_PATHS = CommonCrypto; 612 | SWIFT_OPTIMIZATION_LEVEL = "-Ounchecked"; 613 | TARGETED_DEVICE_FAMILY = "1,2"; 614 | VALIDATE_PRODUCT = YES; 615 | VERSIONING_SYSTEM = "apple-generic"; 616 | VERSION_INFO_PREFIX = ""; 617 | }; 618 | name = Fast; 619 | }; 620 | A2FD6A5E197E8757006FA7EF /* Debug */ = { 621 | isa = XCBuildConfiguration; 622 | buildSettings = { 623 | ALWAYS_SEARCH_USER_PATHS = NO; 624 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 625 | CLANG_CXX_LIBRARY = "libc++"; 626 | CLANG_ENABLE_MODULES = YES; 627 | CLANG_ENABLE_OBJC_ARC = YES; 628 | CLANG_WARN_BOOL_CONVERSION = YES; 629 | CLANG_WARN_CONSTANT_CONVERSION = YES; 630 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 631 | CLANG_WARN_EMPTY_BODY = YES; 632 | CLANG_WARN_ENUM_CONVERSION = YES; 633 | CLANG_WARN_INT_CONVERSION = YES; 634 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 635 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 636 | COPY_PHASE_STRIP = NO; 637 | GCC_C_LANGUAGE_STANDARD = gnu99; 638 | GCC_DYNAMIC_NO_PIC = NO; 639 | GCC_ENABLE_OBJC_EXCEPTIONS = YES; 640 | GCC_OPTIMIZATION_LEVEL = 0; 641 | GCC_PREPROCESSOR_DEFINITIONS = ( 642 | "DEBUG=1", 643 | "$(inherited)", 644 | ); 645 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 646 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 647 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 648 | GCC_WARN_UNDECLARED_SELECTOR = YES; 649 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 650 | GCC_WARN_UNUSED_FUNCTION = YES; 651 | GCC_WARN_UNUSED_VARIABLE = YES; 652 | MACOSX_DEPLOYMENT_TARGET = 10.9; 653 | ONLY_ACTIVE_ARCH = YES; 654 | SDKROOT = macosx; 655 | }; 656 | name = Debug; 657 | }; 658 | A2FD6A5F197E8757006FA7EF /* Release */ = { 659 | isa = XCBuildConfiguration; 660 | buildSettings = { 661 | ALWAYS_SEARCH_USER_PATHS = NO; 662 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 663 | CLANG_CXX_LIBRARY = "libc++"; 664 | CLANG_ENABLE_MODULES = YES; 665 | CLANG_ENABLE_OBJC_ARC = YES; 666 | CLANG_WARN_BOOL_CONVERSION = YES; 667 | CLANG_WARN_CONSTANT_CONVERSION = YES; 668 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 669 | CLANG_WARN_EMPTY_BODY = YES; 670 | CLANG_WARN_ENUM_CONVERSION = YES; 671 | CLANG_WARN_INT_CONVERSION = YES; 672 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 673 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 674 | COPY_PHASE_STRIP = YES; 675 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 676 | ENABLE_NS_ASSERTIONS = NO; 677 | GCC_C_LANGUAGE_STANDARD = gnu99; 678 | GCC_ENABLE_OBJC_EXCEPTIONS = YES; 679 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 680 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 681 | GCC_WARN_UNDECLARED_SELECTOR = YES; 682 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 683 | GCC_WARN_UNUSED_FUNCTION = YES; 684 | GCC_WARN_UNUSED_VARIABLE = YES; 685 | MACOSX_DEPLOYMENT_TARGET = 10.9; 686 | SDKROOT = macosx; 687 | }; 688 | name = Release; 689 | }; 690 | A2FD6A61197E8757006FA7EF /* Debug */ = { 691 | isa = XCBuildConfiguration; 692 | buildSettings = { 693 | CLANG_ENABLE_MODULES = YES; 694 | COMBINE_HIDPI_IMAGES = YES; 695 | DEFINES_MODULE = YES; 696 | DYLIB_COMPATIBILITY_VERSION = 1; 697 | DYLIB_CURRENT_VERSION = 1; 698 | FRAMEWORK_VERSION = A; 699 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 700 | GCC_PREFIX_HEADER = "SHA256/SHA256-Prefix.pch"; 701 | INFOPLIST_FILE = "Supporting Files/Mac/SHA256-Info.plist"; 702 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; 703 | LIBRARY_SEARCH_PATHS = ( 704 | "$(inherited)", 705 | "$(SDKROOT)/usr/lib/system", 706 | ); 707 | PRODUCT_NAME = SHA256Mac; 708 | SWIFT_INCLUDE_PATHS = CommonCrypto; 709 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 710 | WRAPPER_EXTENSION = framework; 711 | }; 712 | name = Debug; 713 | }; 714 | A2FD6A62197E8757006FA7EF /* Release */ = { 715 | isa = XCBuildConfiguration; 716 | buildSettings = { 717 | CLANG_ENABLE_MODULES = YES; 718 | COMBINE_HIDPI_IMAGES = YES; 719 | DEFINES_MODULE = YES; 720 | DYLIB_COMPATIBILITY_VERSION = 1; 721 | DYLIB_CURRENT_VERSION = 1; 722 | FRAMEWORK_VERSION = A; 723 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 724 | GCC_PREFIX_HEADER = "SHA256/SHA256-Prefix.pch"; 725 | INFOPLIST_FILE = "Supporting Files/Mac/SHA256-Info.plist"; 726 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; 727 | LIBRARY_SEARCH_PATHS = ( 728 | "$(inherited)", 729 | "$(SDKROOT)/usr/lib/system", 730 | ); 731 | PRODUCT_NAME = SHA256Mac; 732 | SWIFT_INCLUDE_PATHS = CommonCrypto; 733 | WRAPPER_EXTENSION = framework; 734 | }; 735 | name = Release; 736 | }; 737 | A2FD6A64197E8757006FA7EF /* Debug */ = { 738 | isa = XCBuildConfiguration; 739 | buildSettings = { 740 | CLANG_ENABLE_MODULES = YES; 741 | COMBINE_HIDPI_IMAGES = YES; 742 | FRAMEWORK_SEARCH_PATHS = ( 743 | "$(DEVELOPER_FRAMEWORKS_DIR)", 744 | "$(inherited)", 745 | ); 746 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 747 | GCC_PREFIX_HEADER = "SHA256/SHA256-Prefix.pch"; 748 | GCC_PREPROCESSOR_DEFINITIONS = ( 749 | "DEBUG=1", 750 | "$(inherited)", 751 | ); 752 | INFOPLIST_FILE = "Supporting files/Mac/SHA256Tests-Info.plist"; 753 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; 754 | PRODUCT_NAME = "$(TARGET_NAME)"; 755 | SWIFT_INCLUDE_PATHS = CommonCrypto; 756 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 757 | WRAPPER_EXTENSION = xctest; 758 | }; 759 | name = Debug; 760 | }; 761 | A2FD6A65197E8757006FA7EF /* Release */ = { 762 | isa = XCBuildConfiguration; 763 | buildSettings = { 764 | CLANG_ENABLE_MODULES = YES; 765 | COMBINE_HIDPI_IMAGES = YES; 766 | FRAMEWORK_SEARCH_PATHS = ( 767 | "$(DEVELOPER_FRAMEWORKS_DIR)", 768 | "$(inherited)", 769 | ); 770 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 771 | GCC_PREFIX_HEADER = "SHA256/SHA256-Prefix.pch"; 772 | INFOPLIST_FILE = "Supporting files/Mac/SHA256Tests-Info.plist"; 773 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; 774 | PRODUCT_NAME = "$(TARGET_NAME)"; 775 | SWIFT_INCLUDE_PATHS = CommonCrypto; 776 | WRAPPER_EXTENSION = xctest; 777 | }; 778 | name = Release; 779 | }; 780 | A2FDB89819C079EE00BC4740 /* Debug */ = { 781 | isa = XCBuildConfiguration; 782 | buildSettings = { 783 | CLANG_WARN_UNREACHABLE_CODE = YES; 784 | ENABLE_STRICT_OBJC_MSGSEND = YES; 785 | FRAMEWORK_SEARCH_PATHS = ( 786 | "$(SDKROOT)/Developer/Library/Frameworks", 787 | "$(inherited)", 788 | ); 789 | GCC_PREPROCESSOR_DEFINITIONS = ( 790 | "DEBUG=1", 791 | "$(inherited)", 792 | ); 793 | INFOPLIST_FILE = "Supporting Files/iOs/SHA256Tests-Info.plist"; 794 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 795 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 796 | MTL_ENABLE_DEBUG_INFO = YES; 797 | PRODUCT_NAME = "$(TARGET_NAME)"; 798 | SDKROOT = iphoneos; 799 | SWIFT_INCLUDE_PATHS = CommonCrypto; 800 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 801 | }; 802 | name = Debug; 803 | }; 804 | A2FDB89919C079EE00BC4740 /* Release */ = { 805 | isa = XCBuildConfiguration; 806 | buildSettings = { 807 | CLANG_WARN_UNREACHABLE_CODE = YES; 808 | ENABLE_STRICT_OBJC_MSGSEND = YES; 809 | FRAMEWORK_SEARCH_PATHS = ( 810 | "$(SDKROOT)/Developer/Library/Frameworks", 811 | "$(inherited)", 812 | ); 813 | INFOPLIST_FILE = "Supporting Files/iOs/SHA256Tests-Info.plist"; 814 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 815 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 816 | MTL_ENABLE_DEBUG_INFO = NO; 817 | PRODUCT_NAME = "$(TARGET_NAME)"; 818 | SDKROOT = iphoneos; 819 | SWIFT_INCLUDE_PATHS = CommonCrypto; 820 | VALIDATE_PRODUCT = YES; 821 | }; 822 | name = Release; 823 | }; 824 | A2FDB89A19C079EE00BC4740 /* Fast */ = { 825 | isa = XCBuildConfiguration; 826 | buildSettings = { 827 | CLANG_WARN_UNREACHABLE_CODE = YES; 828 | ENABLE_STRICT_OBJC_MSGSEND = YES; 829 | FRAMEWORK_SEARCH_PATHS = ( 830 | "$(SDKROOT)/Developer/Library/Frameworks", 831 | "$(inherited)", 832 | ); 833 | INFOPLIST_FILE = "Supporting Files/iOs/SHA256Tests-Info.plist"; 834 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 835 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 836 | MTL_ENABLE_DEBUG_INFO = NO; 837 | PRODUCT_NAME = "$(TARGET_NAME)"; 838 | SDKROOT = iphoneos; 839 | SWIFT_INCLUDE_PATHS = CommonCrypto; 840 | VALIDATE_PRODUCT = YES; 841 | }; 842 | name = Fast; 843 | }; 844 | /* End XCBuildConfiguration section */ 845 | 846 | /* Begin XCConfigurationList section */ 847 | A2D39BF4198D841500E2D317 /* Build configuration list for PBXNativeTarget "SHA256iOs" */ = { 848 | isa = XCConfigurationList; 849 | buildConfigurations = ( 850 | A2D39BF5198D841500E2D317 /* Debug */, 851 | A2D39BF6198D841500E2D317 /* Release */, 852 | A2D39BF7198D841500E2D317 /* Fast */, 853 | ); 854 | defaultConfigurationIsVisible = 0; 855 | defaultConfigurationName = Release; 856 | }; 857 | A2FD6A32197E8757006FA7EF /* Build configuration list for PBXProject "SHA256" */ = { 858 | isa = XCConfigurationList; 859 | buildConfigurations = ( 860 | A2FD6A5E197E8757006FA7EF /* Debug */, 861 | A2FD6A5F197E8757006FA7EF /* Release */, 862 | A2230F84197E89B1003C178C /* Fast */, 863 | ); 864 | defaultConfigurationIsVisible = 0; 865 | defaultConfigurationName = Release; 866 | }; 867 | A2FD6A60197E8757006FA7EF /* Build configuration list for PBXNativeTarget "SHA256Mac" */ = { 868 | isa = XCConfigurationList; 869 | buildConfigurations = ( 870 | A2FD6A61197E8757006FA7EF /* Debug */, 871 | A2FD6A62197E8757006FA7EF /* Release */, 872 | A2230F85197E89B1003C178C /* Fast */, 873 | ); 874 | defaultConfigurationIsVisible = 0; 875 | defaultConfigurationName = Release; 876 | }; 877 | A2FD6A63197E8757006FA7EF /* Build configuration list for PBXNativeTarget "SHA256Mac Tests" */ = { 878 | isa = XCConfigurationList; 879 | buildConfigurations = ( 880 | A2FD6A64197E8757006FA7EF /* Debug */, 881 | A2FD6A65197E8757006FA7EF /* Release */, 882 | A2230F86197E89B1003C178C /* Fast */, 883 | ); 884 | defaultConfigurationIsVisible = 0; 885 | defaultConfigurationName = Release; 886 | }; 887 | A2FDB89719C079EE00BC4740 /* Build configuration list for PBXNativeTarget "SHA256iOs Tests" */ = { 888 | isa = XCConfigurationList; 889 | buildConfigurations = ( 890 | A2FDB89819C079EE00BC4740 /* Debug */, 891 | A2FDB89919C079EE00BC4740 /* Release */, 892 | A2FDB89A19C079EE00BC4740 /* Fast */, 893 | ); 894 | defaultConfigurationIsVisible = 0; 895 | defaultConfigurationName = Release; 896 | }; 897 | /* End XCConfigurationList section */ 898 | }; 899 | rootObject = A2FD6A2F197E8757006FA7EF /* Project object */; 900 | } 901 | -------------------------------------------------------------------------------- /SHA256.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /SHA256.xcodeproj/project.xcworkspace/xcshareddata/SHA256.xccheckout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDESourceControlProjectFavoriteDictionaryKey 6 | 7 | IDESourceControlProjectIdentifier 8 | 4376EAEE-60C2-4D27-8D25-6DBAC1D03DCD 9 | IDESourceControlProjectName 10 | SHA256 11 | IDESourceControlProjectOriginsDictionary 12 | 13 | 474B4483-285D-430F-B5B4-1E2E3DF350EA 14 | ssh://github.com/CryptoCoinSwift/SHA256-Swift.git 15 | 16 | IDESourceControlProjectPath 17 | SHA256/SHA256.xcodeproj/project.xcworkspace 18 | IDESourceControlProjectRelativeInstallPathDictionary 19 | 20 | 474B4483-285D-430F-B5B4-1E2E3DF350EA 21 | ../../.. 22 | 23 | IDESourceControlProjectURL 24 | ssh://github.com/CryptoCoinSwift/SHA256-Swift.git 25 | IDESourceControlProjectVersion 26 | 110 27 | IDESourceControlProjectWCCIdentifier 28 | 474B4483-285D-430F-B5B4-1E2E3DF350EA 29 | IDESourceControlProjectWCConfigurations 30 | 31 | 32 | IDESourceControlRepositoryExtensionIdentifierKey 33 | public.vcs.git 34 | IDESourceControlWCCIdentifierKey 35 | 474B4483-285D-430F-B5B4-1E2E3DF350EA 36 | IDESourceControlWCCName 37 | SHA256-Swift 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /SHA256Tests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SHA256Tests.swift 3 | // CryptoCoin 4 | // 5 | // Created by Sjors Provoost on 07-07-14. 6 | // Copyright (c) 2014 Crypto Coin Swift. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | #if os(OSX) 11 | import SHA256Mac 12 | #else 13 | import SHA256iOs 14 | #endif 15 | 16 | class SHA256Tests: XCTestCase { 17 | 18 | override func setUp() { 19 | super.setUp() 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | } 22 | 23 | override func tearDown() { 24 | // Put teardown code here. This method is called after the invocation of each test method in the class. 25 | super.tearDown() 26 | } 27 | 28 | func testHash() { 29 | let digest: String = SHA256.hexStringDigest("800C28FCA386C7A227600B2FE50B7CAE11EC86D3BF1FBE471BE89827E19D72AA1D") 30 | 31 | XCTAssertEqual(digest, "8147786c4d15106333bf278d71dadaf1079ef2d2440a4dde37d747ded5403592", digest) 32 | } 33 | 34 | func testDoubleHash() { 35 | let digest1: NSData = SHA256.hexStringDigest("800C28FCA386C7A227600B2FE50B7CAE11EC86D3BF1FBE471BE89827E19D72AA1D") 36 | 37 | let digest2: String = SHA256.hexStringDigest(digest1) 38 | 39 | 40 | XCTAssertEqual(digest2, "507a5b8dfed0fc6fe8801743720cedec06aa5c6fca72b07c49964492fb98a714", digest2) 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /SHA256iOs/SHA256iOs.h: -------------------------------------------------------------------------------- 1 | // 2 | // SHA256.h 3 | // SHA256 4 | // 5 | // Created by Sjors Provoost on 02-08-14. 6 | // 7 | 8 | #import 9 | 10 | //! Project version number for SHA256. 11 | FOUNDATION_EXPORT double SHA256iVersionNumber; 12 | 13 | //! Project version string for SHA256. 14 | FOUNDATION_EXPORT const unsigned char SHA256iVersionString[]; 15 | 16 | // In this header, you should import all the public headers of your framework using statements like #import 17 | 18 | 19 | -------------------------------------------------------------------------------- /Supporting Files/Mac/SHA256-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | com.cryptocoinswift.${PRODUCT_NAME:rfc1034identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | FMWK 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | NSHumanReadableCopyright 26 | Copyright © 2014 Crypto Coin Swift. All rights reserved. 27 | NSPrincipalClass 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /Supporting Files/Mac/SHA256Tests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | com.cryptocoinswift.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /Supporting Files/iOs/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | com.cryptocoinswift.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Supporting Files/iOs/SHA256Tests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | com.cryptocoinswift.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /iOs.playground/contents.xcplayground: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /iOs.playground/section-1.swift: -------------------------------------------------------------------------------- 1 | // Note: this currently doesn't work 2 | 3 | // To use this Playground select SHA256 Mac as the scheme and build. 4 | import CommonCrypto // "No such module "CommonCrypto" 5 | import SHA256iOs // "Missing required module 'CommonCrypto" 6 | 7 | let digest: String = SHA256.hexStringDigest("800C28FCA386C7A227600B2FE50B7CAE11EC86D3BF1FBE471BE89827E19D72AA1D") 8 | 9 | -------------------------------------------------------------------------------- /iOs.playground/timeline.xctimeline: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | --------------------------------------------------------------------------------