├── Sources ├── module.map ├── TweetNacl │ ├── TweetNacl.h │ ├── Constant.swift │ └── TweetNacl.swift └── CTweetNacl │ ├── ctweetnacl.c │ └── include │ └── ctweetnacl.h ├── Tests ├── LinuxMain.swift └── TweetNaclTests │ ├── NaclBox_Tests.swift │ ├── NaclSecretbox_Tests.swift │ ├── NaclScalarMulti_Tests.swift │ ├── NaclSign_Tests.swift │ └── ScalarMultiTestData.json ├── TweetNacl.xcodeproj ├── project.xcworkspace │ └── contents.xcworkspacedata ├── xcshareddata │ └── xcschemes │ │ ├── TweetNacl-watchOS.xcscheme │ │ ├── TweetNacl-iOS.xcscheme │ │ ├── TweetNacl-tvOS.xcscheme │ │ └── TweetNacl-macOS.xcscheme └── project.pbxproj ├── .travis.yml ├── .codecov.yml ├── Configs ├── TweetNaclTests.plist └── TweetNacl.plist ├── Package.swift ├── TweetNacl.podspec ├── LICENSE ├── .gitignore └── README.md /Sources/module.map: -------------------------------------------------------------------------------- 1 | module CTweetNacl [system] { 2 | header "CTweetNacl/include/ctweetnacl.h" 3 | export * 4 | } 5 | -------------------------------------------------------------------------------- /Tests/LinuxMain.swift: -------------------------------------------------------------------------------- 1 | import XCTest 2 | @testable import TweetNaclTests 3 | 4 | XCTMain([ 5 | testCase(TweetNaclTests.allTests), 6 | ]) 7 | -------------------------------------------------------------------------------- /TweetNacl.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: objective-c 2 | osx_image: xcode13.2 3 | branches: 4 | only: 5 | - master 6 | 7 | before_install: 8 | - gem install xcpretty 9 | 10 | script: 11 | - swift build 12 | - swift test 13 | after_success: bash <(curl -s https://codecov.io/bash) -------------------------------------------------------------------------------- /Sources/TweetNacl/TweetNacl.h: -------------------------------------------------------------------------------- 1 | // 2 | // TweetNacl.h 3 | // TweetNacl 4 | // 5 | // Created by Anh Nguyen on 10/20/17. 6 | // Copyright © 2017 Bitmark. All rights reserved. 7 | // 8 | 9 | #ifndef TweetNacl_h 10 | #define TweetNacl_h 11 | 12 | 13 | #endif /* TweetNacl_h */ 14 | -------------------------------------------------------------------------------- /.codecov.yml: -------------------------------------------------------------------------------- 1 | ignore: 2 | - "/tests/*" 3 | comment: 4 | layout: "header, diff" 5 | behavior: default 6 | require_changes: no 7 | coverage: 8 | status: 9 | project: 10 | default: 11 | target: auto 12 | threshold: null 13 | base: auto 14 | paths: "sources/*" -------------------------------------------------------------------------------- /Configs/TweetNaclTests.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 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 | -------------------------------------------------------------------------------- /Package.swift: -------------------------------------------------------------------------------- 1 | // swift-tools-version:5.5 2 | // The swift-tools-version declares the minimum version of Swift required to build this package. 3 | 4 | import PackageDescription 5 | 6 | let package = Package( 7 | name: "TweetNacl", 8 | products: [ 9 | .library( 10 | name: "TweetNacl", 11 | targets: ["TweetNacl"]), 12 | ], 13 | dependencies: [], 14 | targets: [ 15 | .target(name: "CTweetNacl"), 16 | .target( 17 | name: "TweetNacl", 18 | dependencies: ["CTweetNacl"]), 19 | .testTarget( 20 | name: "TweetNaclTests", 21 | dependencies: ["TweetNacl"], 22 | resources: [ 23 | .process("SecretboxTestData.json"), 24 | .process("BoxTestData.json"), 25 | .process("ScalarMultiTestData.json"), 26 | .process("SignTestData.json") 27 | ] 28 | ), 29 | ] 30 | ) 31 | -------------------------------------------------------------------------------- /Configs/TweetNacl.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 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 | NSHumanReadableCopyright 24 | Copyright © 2017 Anh Nguyen. All rights reserved. 25 | NSPrincipalClass 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /TweetNacl.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = "TweetNacl" 3 | s.version = "1.1.1" 4 | s.summary = "TweetNacl wrapper library written in Swift." 5 | s.description = <<-DESC 6 | A Swift wrapper for TweetNacl C library 7 | DESC 8 | s.homepage = "https://github.com/bitmark-inc/tweetnacl-swiftwrap" 9 | s.license = { :type => "MIT", :file => "LICENSE" } 10 | s.author = { "Bitmark Inc" => "support@bitmark.com" } 11 | s.social_media_url = "https://twitter.com/bitmarkinc" 12 | s.ios.deployment_target = "8.0" 13 | s.osx.deployment_target = "10.9" 14 | s.watchos.deployment_target = "2.0" 15 | s.tvos.deployment_target = "9.0" 16 | s.source = { :git => "https://github.com/bitmark-inc/tweetnacl-swiftwrap.git", :tag => s.version } 17 | s.source_files = "Sources/**/*.{h,c,swift}" 18 | s.private_header_files = 'Sources/CTweetNacl/include/*.h' 19 | s.preserve_paths = 'Sources/module.map' 20 | s.frameworks = "Foundation" 21 | s.xcconfig = { 'SWIFT_INCLUDE_PATHS' => '$(PODS_ROOT)/TweetNacl/Sources' } 22 | end 23 | -------------------------------------------------------------------------------- /Sources/TweetNacl/Constant.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Constant.swift 3 | // TweetnaclSwift 4 | // 5 | // Created by Anh Nguyen on 12/9/16. 6 | // Copyright © 2016 Bitmark. All rights reserved. 7 | // 8 | 9 | struct Constants { 10 | struct Box { 11 | static let publicKeyBytes = 32 12 | static let secretKeyBytes = 32 13 | static let beforeNMBytes = 32 14 | static let nonceBytes = Secretbox.nonceBytes 15 | static let zeroBytes = Secretbox.zeroBytes 16 | static let boxZeroBytes = Secretbox.boxZeroBytes 17 | } 18 | 19 | struct Hash { 20 | static let bytes = 64 21 | } 22 | 23 | struct Scalarmult { 24 | static let bytes = 32 25 | static let scalarBytes = 32 26 | } 27 | 28 | struct Secretbox { 29 | static let keyBytes = 32 30 | static let nonceBytes = 24 31 | static let zeroBytes = 32 32 | static let boxZeroBytes = 16 33 | } 34 | 35 | struct Sign { 36 | static let bytes = 64 37 | static let publicKeyBytes = 32 38 | static let secretKeyBytes = 64 39 | static let seedBytes = 32 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2017 Bitmark 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | 5 | ## Build generated 6 | build/ 7 | DerivedData/ 8 | 9 | ## Various settings 10 | *.pbxuser 11 | !default.pbxuser 12 | *.mode1v3 13 | !default.mode1v3 14 | *.mode2v3 15 | !default.mode2v3 16 | *.perspectivev3 17 | !default.perspectivev3 18 | xcuserdata/ 19 | 20 | ## Other 21 | *.moved-aside 22 | *.xccheckout 23 | *.xcscmblueprint 24 | 25 | ## Obj-C/Swift specific 26 | *.hmap 27 | *.ipa 28 | *.dSYM.zip 29 | *.dSYM 30 | 31 | ## Playgrounds 32 | timeline.xctimeline 33 | playground.xcworkspace 34 | 35 | # Swift Package Manager 36 | # 37 | # Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. 38 | # Packages/ 39 | # Package.pins 40 | .build/ 41 | 42 | # CocoaPods 43 | # 44 | # We recommend against adding the Pods directory to your .gitignore. However 45 | # you should judge for yourself, the pros and cons are mentioned at: 46 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 47 | # 48 | # Pods/ 49 | 50 | # Carthage 51 | # 52 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 53 | # Carthage/Checkouts 54 | 55 | Carthage/Build 56 | 57 | # fastlane 58 | # 59 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 60 | # screenshots whenever they are needed. 61 | # For more information about the recommended setup visit: 62 | # https://docs.fastlane.tools/best-practices/source-control/#source-control 63 | 64 | fastlane/report.xml 65 | fastlane/Preview.html 66 | fastlane/screenshots 67 | fastlane/test_output 68 | -------------------------------------------------------------------------------- /Tests/TweetNaclTests/NaclBox_Tests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // NaclBox_Tests.swift 3 | // NaclBox_Tests 4 | // 5 | // Created by Anh Nguyen on 12/12/16. 6 | // Copyright © 2016 Bitmark. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | @testable import TweetNacl 11 | 12 | class NaclBox_Test: XCTestCase { 13 | 14 | public var data: Array? 15 | private var nonce = Data(count: Constants.Box.nonceBytes) 16 | 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 testBox() { 29 | let pk = Data(base64Encoded: data![0])! 30 | let sk = Data(base64Encoded: data![1])! 31 | let msg = Data(base64Encoded: data![2])! 32 | let goodBox = data![3] 33 | 34 | do { 35 | let box = try NaclBox.box(message: msg, nonce: nonce, publicKey: pk, secretKey: sk) 36 | let boxEncoded = box.base64EncodedString() 37 | let open = try NaclBox.open(message: box, nonce: nonce, publicKey: pk, secretKey: sk) 38 | 39 | XCTAssertEqual(boxEncoded, goodBox) 40 | XCTAssertEqual(open, msg) 41 | } 42 | catch { 43 | XCTFail() 44 | } 45 | } 46 | 47 | override class var defaultTestSuite: XCTestSuite { 48 | 49 | let testSuite = XCTestSuite(name: NSStringFromClass(self)) 50 | 51 | let fileURL = Bundle.module.url(forResource: "BoxTestData", withExtension: "json") 52 | let fileData = try! Data(contentsOf: fileURL!) 53 | let json = try! JSONSerialization.jsonObject(with: fileData, options: []) 54 | let arrayOfData = json as! [Array] 55 | 56 | for array in arrayOfData { 57 | addTestsWithArray(array: array, toTestSuite: testSuite) 58 | } 59 | 60 | return testSuite 61 | } 62 | 63 | private class func addTestsWithArray(array: [String], toTestSuite testSuite: XCTestSuite) { 64 | // Returns an array of NSInvocation, which are not available in Swift, but still seems to work. 65 | let invocations = self.testInvocations 66 | for invocation in invocations { 67 | 68 | // We can't directly use the NSInvocation type in our source, but it appears 69 | // that we can pass it on through. 70 | let testCase = NaclBox_Test(invocation: invocation) 71 | 72 | // Normally the "parameterized" values are passed during initialization. 73 | // This is a "good enough" workaround. You'll see that I simply force unwrap 74 | // the optional at the callspot. 75 | testCase.data = array 76 | 77 | testSuite.addTest(testCase) 78 | } 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /Tests/TweetNaclTests/NaclSecretbox_Tests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // NaclSecretbox_Tests.swift 3 | // TweetnaclSwift 4 | // 5 | // Created by Anh Nguyen on 12/14/16. 6 | // Copyright © 2016 Bitmark. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | import XCTest 12 | @testable import TweetNacl 13 | 14 | class NaclSecretbox_Tests: XCTestCase { 15 | 16 | public var data: [String]? 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 testSecretBox() { 29 | let key = Data(base64Encoded: data![0])! 30 | let nonce = Data(base64Encoded: data![1])! 31 | let encodedMessage = data![2] 32 | let msg = Data(base64Encoded: encodedMessage)! 33 | let goodBox = data![3] 34 | 35 | do { 36 | let box = try NaclSecretBox.secretBox(message: msg, nonce: nonce, key: key) 37 | let boxEncoded = box.base64EncodedString() 38 | 39 | XCTAssertEqual(boxEncoded, goodBox) 40 | 41 | let openedBox = try NaclSecretBox.open(box: box, nonce: nonce, key: key) 42 | XCTAssertNotNil(openedBox) 43 | XCTAssertEqual(openedBox.base64EncodedString(), encodedMessage) 44 | } 45 | catch { 46 | XCTFail() 47 | } 48 | } 49 | 50 | override class var defaultTestSuite: XCTestSuite { 51 | 52 | let testSuite = XCTestSuite(name: NSStringFromClass(self)) 53 | 54 | let fileURL = Bundle.module.url(forResource: "SecretboxTestData", withExtension: "json") 55 | let fileData = try! Data(contentsOf: fileURL!) 56 | let jsonDecoder = JSONDecoder() 57 | let arrayOfData = try! jsonDecoder.decode([[String]].self, from: fileData) 58 | 59 | for array in arrayOfData { 60 | addTestsWithArray(array: array, toTestSuite: testSuite) 61 | } 62 | 63 | return testSuite 64 | } 65 | 66 | private class func addTestsWithArray(array: [String], toTestSuite testSuite: XCTestSuite) { 67 | // Returns an array of NSInvocation, which are not available in Swift, but still seems to work. 68 | let invocations = self.testInvocations 69 | for invocation in invocations { 70 | 71 | // We can't directly use the NSInvocation type in our source, but it appears 72 | // that we can pass it on through. 73 | let testCase = NaclSecretbox_Tests(invocation: invocation) 74 | 75 | // Normally the "parameterized" values are passed during initialization. 76 | // This is a "good enough" workaround. You'll see that I simply force unwrap 77 | // the optional at the callspot. 78 | testCase.data = array 79 | 80 | testSuite.addTest(testCase) 81 | } 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /TweetNacl.xcodeproj/xcshareddata/xcschemes/TweetNacl-watchOS.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 31 | 32 | 33 | 34 | 35 | 36 | 46 | 47 | 53 | 54 | 55 | 56 | 57 | 58 | 64 | 65 | 71 | 72 | 73 | 74 | 76 | 77 | 80 | 81 | 82 | -------------------------------------------------------------------------------- /TweetNacl.xcodeproj/xcshareddata/xcschemes/TweetNacl-iOS.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 31 | 32 | 34 | 40 | 41 | 42 | 43 | 44 | 50 | 51 | 52 | 53 | 54 | 55 | 65 | 66 | 72 | 73 | 74 | 75 | 76 | 77 | 83 | 84 | 90 | 91 | 92 | 93 | 95 | 96 | 99 | 100 | 101 | -------------------------------------------------------------------------------- /TweetNacl.xcodeproj/xcshareddata/xcschemes/TweetNacl-tvOS.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 31 | 32 | 34 | 40 | 41 | 42 | 43 | 44 | 50 | 51 | 52 | 53 | 54 | 55 | 65 | 66 | 72 | 73 | 74 | 75 | 76 | 77 | 83 | 84 | 90 | 91 | 92 | 93 | 95 | 96 | 99 | 100 | 101 | -------------------------------------------------------------------------------- /TweetNacl.xcodeproj/xcshareddata/xcschemes/TweetNacl-macOS.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 31 | 32 | 34 | 40 | 41 | 42 | 43 | 44 | 50 | 51 | 52 | 53 | 54 | 55 | 65 | 66 | 72 | 73 | 74 | 75 | 76 | 77 | 83 | 84 | 90 | 91 | 92 | 93 | 95 | 96 | 99 | 100 | 101 | -------------------------------------------------------------------------------- /Tests/TweetNaclTests/NaclScalarMulti_Tests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // NaclScalarMulti_Tests.swift 3 | // TweetnaclSwift 4 | // 5 | // Created by Anh Nguyen on 12/14/16. 6 | // Copyright © 2016 Bitmark. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | @testable import TweetNacl 11 | 12 | class NaclScalarMulti_Tests: XCTestCase { 13 | public var data: Array? 14 | 15 | override func setUp() { 16 | super.setUp() 17 | // Put setup code here. This method is called before the invocation of each test method in the class. 18 | 19 | } 20 | 21 | override func tearDown() { 22 | // Put teardown code here. This method is called after the invocation of each test method in the class. 23 | super.tearDown() 24 | } 25 | 26 | // func testMultiBase() { 27 | // let testBytes : [UInt8] = [0x14, 0x00, 0xAB, 0x45, 0x49, 0x1F, 0xEF, 0x15, 28 | // 0xA8, 0x89, 0x78, 0x0F, 0x09, 0xA9, 0x07, 0xB0, 29 | // 0x01, 0x20, 0x01, 0x4E, 0x38, 0x32, 0x35, 0x56, 30 | // 0x20, 0x20, 0x20, 0x00] 31 | // let golden = NSData(bytes: testBytes, length: testBytes.count) 32 | // 33 | // do { 34 | // let inputByte : [UInt8] = [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 35 | // 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] 36 | // var input = NSData(bytes: inputByte, length: inputByte.count) 37 | // 38 | // for _ in 0..<200 { 39 | // input = try NaclScalarMult.base(n: input) 40 | // } 41 | // 42 | // XCTAssertEqual(NaclUtil.encodeBase64(data: input), NaclUtil.encodeBase64(data: golden)) 43 | // } 44 | // catch { 45 | // XCTFail() 46 | // } 47 | // } 48 | 49 | func testScalarMulti() { 50 | let pk1Dec = data![0] 51 | let pk1 = Data(base64Encoded: pk1Dec)! 52 | let sk1 = Data(base64Encoded: data![1])! 53 | let pk2Dec = data![2] 54 | let pk2 = Data(base64Encoded: pk2Dec)! 55 | let sk2 = Data(base64Encoded: data![3])! 56 | let out = data![4] 57 | 58 | do { 59 | let jpk1 = try NaclScalarMult.base(n: sk1) 60 | XCTAssertEqual(jpk1.base64EncodedString(), pk1Dec) 61 | 62 | let jpk2 = try NaclScalarMult.base(n: sk2) 63 | XCTAssertEqual(jpk2.base64EncodedString(), pk2Dec) 64 | 65 | let jout1 = try NaclScalarMult.scalarMult(n: sk1, p: pk2) 66 | XCTAssertEqual(jout1.base64EncodedString(), out) 67 | 68 | let jout2 = try NaclScalarMult.scalarMult(n: sk2, p: pk1) 69 | XCTAssertEqual(jout2.base64EncodedString(), out) 70 | } 71 | catch { 72 | XCTFail() 73 | } 74 | } 75 | 76 | override class var defaultTestSuite: XCTestSuite { 77 | 78 | let testSuite = XCTestSuite(name: NSStringFromClass(self)) 79 | 80 | let fileURL = Bundle.module.url(forResource: "ScalarMultiTestData", withExtension: "json") 81 | let fileData = try! Data(contentsOf: fileURL!) 82 | let json = try! JSONSerialization.jsonObject(with: fileData, options: []) 83 | let arrayOfData = json as! [Array] 84 | 85 | for array in arrayOfData { 86 | addTestsWithArray(array: array, toTestSuite: testSuite) 87 | } 88 | 89 | return testSuite 90 | } 91 | 92 | private class func addTestsWithArray(array: [String], toTestSuite testSuite: XCTestSuite) { 93 | // Returns an array of NSInvocation, which are not available in Swift, but still seems to work. 94 | let invocations = self.testInvocations 95 | for invocation in invocations { 96 | 97 | // We can't directly use the NSInvocation type in our source, but it appears 98 | // that we can pass it on through. 99 | let testCase = NaclScalarMulti_Tests(invocation: invocation) 100 | 101 | // Normally the "parameterized" values are passed during initialization. 102 | // This is a "good enough" workaround. You'll see that I simply force unwrap 103 | // the optional at the callspot. 104 | testCase.data = array 105 | 106 | testSuite.addTest(testCase) 107 | } 108 | } 109 | 110 | } 111 | -------------------------------------------------------------------------------- /Tests/TweetNaclTests/NaclSign_Tests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // NaclSign_Tests.swift 3 | // NaclSign_Tests 4 | // 5 | // Created by Anh Nguyen on 12/12/16. 6 | // Copyright © 2016 Bitmark. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | @testable import TweetNacl 11 | 12 | class NaclSign_Test: XCTestCase { 13 | 14 | 15 | override func setUp() { 16 | super.setUp() 17 | // Put setup code here. This method is called before the invocation of each test method in the class. 18 | 19 | } 20 | 21 | override func tearDown() { 22 | // Put teardown code here. This method is called after the invocation of each test method in the class. 23 | super.tearDown() 24 | } 25 | 26 | func testKeyPair() { 27 | do { 28 | let keypair = try NaclSign.KeyPair.keyPair() 29 | XCTAssertEqual(keypair.publicKey.count, Constants.Sign.publicKeyBytes) 30 | XCTAssertEqual(keypair.secretKey.count, Constants.Sign.secretKeyBytes) 31 | XCTAssertNotEqual(keypair.secretKey.count, keypair.publicKey.count) 32 | XCTAssertNotEqual(keypair.secretKey.base64EncodedString(), keypair.publicKey.base64EncodedString()) 33 | } 34 | catch { 35 | XCTFail() 36 | } 37 | 38 | } 39 | 40 | func testKeyPairFromSecret() { 41 | do { 42 | let k1 = try NaclSign.KeyPair.keyPair() 43 | let k2 = try NaclSign.KeyPair.keyPair(fromSecretKey: k1.secretKey) 44 | XCTAssertEqual(k1.secretKey.base64EncodedString(), k2.secretKey.base64EncodedString()) 45 | XCTAssertEqual(k1.publicKey.base64EncodedString(), k2.publicKey.base64EncodedString()) 46 | } 47 | catch { 48 | XCTFail() 49 | } 50 | } 51 | 52 | func testSignOpen() { 53 | do { 54 | let keypair = try NaclSign.KeyPair.keyPair() 55 | 56 | let bytes = [UInt32](repeating: 0, count: 100).map { _ in 0xff } 57 | let message = Data(bytes: bytes, count: 100) 58 | 59 | let signedMessage = try NaclSign.sign(message: message, secretKey: keypair.secretKey) 60 | XCTAssertNotNil(signedMessage, "Message must be signed") 61 | 62 | let openedMessage = try NaclSign.signOpen(signedMessage: signedMessage, publicKey: keypair.publicKey) 63 | XCTAssertNotNil(openedMessage, "Signed Message must be opened") 64 | } 65 | catch { 66 | XCTFail() 67 | } 68 | } 69 | 70 | func testSignFromSeed() { 71 | do { 72 | let seed = try NaclUtil.secureRandomData(count: Constants.Sign.seedBytes) 73 | let k1 = try NaclSign.KeyPair.keyPair(fromSeed: seed) 74 | let k2 = try NaclSign.KeyPair.keyPair(fromSeed: seed) 75 | 76 | XCTAssertEqual(k1.secretKey.count, Constants.Sign.secretKeyBytes) 77 | XCTAssertEqual(k1.publicKey.count, Constants.Sign.publicKeyBytes) 78 | XCTAssertEqual(k2.secretKey.count, Constants.Sign.secretKeyBytes) 79 | XCTAssertEqual(k2.publicKey.count, Constants.Sign.publicKeyBytes) 80 | XCTAssertEqual(k1.secretKey.base64EncodedString(), k2.secretKey.base64EncodedString()) 81 | XCTAssertEqual(k1.publicKey.base64EncodedString(), k2.publicKey.base64EncodedString()) 82 | } 83 | catch { 84 | XCTFail() 85 | } 86 | } 87 | 88 | func testDetachedAndVerify() { 89 | do { 90 | let k = try NaclSign.KeyPair.keyPair() 91 | var bytes = [UInt32](repeating: 0, count: 100) 92 | for index in 0.. 1.0 55 | ``` 56 | 57 | Run `carthage update` to build the framework and drag the built `TweetNacl.framework` into your Xcode project. 58 | 59 | ### Swift Package Manager 60 | 61 | The [Swift Package Manager](https://swift.org/package-manager/) is a tool for automating the distribution of Swift code and is integrated into the `swift` compiler. It is in early development, but TweetNacl does support its use on supported platforms. 62 | 63 | Once you have your Swift package set up, adding TweetNacl as a dependency is as easy as adding it to the `dependencies` value of your `Package.swift`. 64 | 65 | ```swift 66 | dependencies: [ 67 | .Package(url: "https://github.com/bitmark-inc/tweetnacl-swiftwrap.git", majorVersion: 1) 68 | ] 69 | ``` 70 | 71 | ### Manually 72 | 73 | If you prefer not to use any of the aforementioned dependency managers, you can integrate TweetNacl into your project manually. 74 | 75 | #### Embedded Framework 76 | 77 | - Open up Terminal, `cd` into your top-level project directory, and run the following command "if" your project is not initialized as a git repository: 78 | 79 | ```bash 80 | $ git init 81 | ``` 82 | 83 | - Add TweetNacl as a git [submodule](http://git-scm.com/docs/git-submodule) by running the following command: 84 | 85 | ```bash 86 | $ git submodule add https://github.com/bitmark-inc/tweetnacl-swiftwrap.git 87 | ``` 88 | 89 | - Open the new `TweetNacl` folder, and drag the `TweetNacl.xcodeproj` into the Project Navigator of your application's Xcode project. 90 | 91 | > It should appear nested underneath your application's blue project icon. Whether it is above or below all the other Xcode groups does not matter. 92 | 93 | - Select the `TweetNacl.xcodeproj` in the Project Navigator and verify the deployment target matches that of your application target. 94 | - Next, select your application project in the Project Navigator (blue project icon) to navigate to the target configuration window and select the application target under the "Targets" heading in the sidebar. 95 | - In the tab bar at the top of that window, open the "General" panel. 96 | - Click on the `+` button under the "Embedded Binaries" section. 97 | - You will see two different `TweetNacl.xcodeproj` folders each with two different versions of the `TweetNacl.framework` nested inside a `Products` folder. 98 | 99 | > It does not matter which `Products` folder you choose from, but it does matter whether you choose the top or bottom `TweetNacl.framework`. 100 | 101 | - Select the top `TweetNacl.framework` for iOS and the bottom one for OS X. 102 | 103 | > You can verify which one you selected by inspecting the build log for your project. The build target for `TweetNacl` will be listed as either `TweetNacl-iOS`, `TweetNacl-macOS`, `TweetNacl-tvOS` or `TweetNacl-watchOS`. 104 | 105 | - And that's it! 106 | 107 | > The `TweetNacl.framework` is automagically added as a target dependency, linked framework and embedded framework in a copy files build phase which is all you need to build on the simulator and a device. 108 | 109 | --- 110 | 111 | ## Usage 112 | All API functions accept and return [Data](https://developer.apple.com/documentation/foundation/data). 113 | 114 | ### Public-key authenticated encryption (box) 115 | 116 | Implements *curve25519-xsalsa20-poly1305*. 117 | 118 | #### NaclBox.keyPair() 119 | 120 | Generates a new random key pair for box and returns it as an object with 121 | `publicKey` and `secretKey` members: 122 | 123 | { 124 | publicKey: ..., // Data with 32-byte public key 125 | secretKey: ... // Data with 32-byte secret key 126 | } 127 | 128 | 129 | #### NaclBox.keyPair(fromSecretKey:) 130 | 131 | Returns a key pair for box with public key corresponding to the given secret 132 | key. 133 | 134 | #### NaclBox.box(message, nonce, theirPublicKey, mySecretKey) 135 | 136 | Encrypt and authenticates message using peer's public key, our secret key, and 137 | the given nonce, which must be unique for each distinct message for a key pair. 138 | 139 | #### NaclBox.open(box, nonce, theirPublicKey, mySecretKey) 140 | 141 | Authenticates and decrypts the given box with peer's public key, our secret 142 | key, and the given nonce. 143 | 144 | Returns the original message, or `false` if authentication fails. 145 | 146 | #### NaclBox.before(theirPublicKey, mySecretKey) 147 | 148 | Returns a precomputed shared key which can be used in `NaclBox.after` and 149 | `NaclBox.open.after`. 150 | 151 | #### NaclBox.after(message, nonce, sharedKey) 152 | 153 | Same as `NaclBox`, but uses a shared key precomputed with `NaclBox.before`. 154 | 155 | #### NaclBox.open.after(box, nonce, sharedKey) 156 | 157 | Same as `NaclBox.open`, but uses a shared key precomputed with `NaclBox.before`. 158 | 159 | #### NaclBox.publicKeyLength = 32 160 | 161 | Length of public key in bytes. 162 | 163 | #### NaclBox.secretKeyLength = 32 164 | 165 | Length of secret key in bytes. 166 | 167 | #### NaclBox.sharedKeyLength = 32 168 | 169 | Length of precomputed shared key in bytes. 170 | 171 | #### NaclBox.nonceLength = 24 172 | 173 | Length of nonce in bytes. 174 | 175 | #### NaclBox.overheadLength = 16 176 | 177 | Length of overhead added to box compared to original message. 178 | 179 | 180 | ### Secret-key authenticated encryption (secretbox) 181 | 182 | Implements *xsalsa20-poly1305*. 183 | 184 | #### NaclSecretBox.secretBox(message, nonce, key) 185 | 186 | Encrypt and authenticates message using the key and the nonce. The nonce must 187 | be unique for each distinct message for this key. 188 | 189 | Returns an encrypted and authenticated message. 190 | 191 | #### NaclSecretBox.open(box, nonce, key) 192 | 193 | Authenticates and decrypts the given secret box using the key and the nonce. 194 | 195 | Returns the original message, or `false` if authentication fails. 196 | 197 | #### NaclSecretBox.keyLength = 32 198 | 199 | Length of key in bytes. 200 | 201 | #### NaclSecretBox.nonceLength = 24 202 | 203 | Length of nonce in bytes. 204 | 205 | #### NaclSecretBox.overheadLength = 16 206 | 207 | Length of overhead added to secret box compared to original message. 208 | 209 | 210 | ### Scalar multiplication 211 | 212 | Implements [e25519](http://ed25519.cr.yp.to). 213 | 214 | #### NaclScalarMult(n, p) 215 | 216 | Multiplies an integer `n` by a group element `p` and returns the resulting 217 | group element. 218 | 219 | #### NaclScalarMult.base(n) 220 | 221 | Multiplies an integer `n` by a standard group element and returns the resulting 222 | group element. 223 | 224 | #### NaclScalarMult.scalarLength = 32 225 | 226 | Length of scalar in bytes. 227 | 228 | #### NaclScalarMult.groupElementLength = 32 229 | 230 | Length of group element in bytes. 231 | 232 | 233 | ### Signatures 234 | 235 | Implements [ed25519](http://ed25519.cr.yp.to). 236 | 237 | #### NaclSign.keyPair() 238 | 239 | Generates new random key pair for signing and returns it as an object with 240 | `publicKey` and `secretKey` members: 241 | 242 | { 243 | publicKey: ..., // Data with 32-byte public key 244 | secretKey: ... // Data with 64-byte secret key 245 | } 246 | 247 | #### NaclSign.keyPair.fromSecretKey(secretKey) 248 | 249 | Returns a signing key pair with public key corresponding to the given 250 | 64-byte secret key. The secret key must have been generated by 251 | `NaclSign.KeyPair` or `NaclSign.KeyPair.fromSeed`. 252 | 253 | #### NaclSign.keyPair.fromSeed(seed) 254 | 255 | Returns a new signing key pair generated deterministically from a 32-byte seed. 256 | The seed must contain enough entropy to be secure. This method is not 257 | recommended for general use: instead, use `NaclSign.KeyPair` to generate a new 258 | key pair from a random seed. 259 | 260 | #### NaclSign(message, secretKey) 261 | 262 | Signs the message using the secret key and returns a signed message. 263 | 264 | #### NaclSign.open(signedMessage, publicKey) 265 | 266 | Verifies the signed message and returns the message without signature. 267 | 268 | Returns `nil` if verification failed. 269 | 270 | #### NaclSign.detached(message, secretKey) 271 | 272 | Signs the message using the secret key and returns a signature. 273 | 274 | #### NaclSign.detached.verify(message, signature, publicKey) 275 | 276 | Verifies the signature for the message and returns `true` if verification 277 | succeeded or `false` if it failed. 278 | 279 | #### NaclSign.publicKeyLength = 32 280 | 281 | Length of signing public key in bytes. 282 | 283 | #### NaclSign.secretKeyLength = 64 284 | 285 | Length of signing secret key in bytes. 286 | 287 | #### NaclSign.seedLength = 32 288 | 289 | Length of seed for `NaclSign.KeyPair.keyPair(fromSeed:` in bytes. 290 | 291 | #### NaclSign.signatureLength = 64 292 | 293 | Length of signature in bytes. 294 | 295 | 296 | 297 | # License 298 | 299 | Copyright (c) 2014-2015 Bitmark Inc (support@bitmark.com). 300 | 301 | Permission to use, copy, modify, and distribute this software for any 302 | purpose with or without fee is hereby granted, provided that the above 303 | copyright notice and this permission notice appear in all copies. 304 | 305 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 306 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 307 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 308 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 309 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 310 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 311 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -------------------------------------------------------------------------------- /Sources/TweetNacl/TweetNacl.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Tweetnacl.swift 3 | // TweetnaclSwift 4 | // 5 | // Created by Anh Nguyen on 12/9/16. 6 | // Copyright © 2016 Bitmark. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import CTweetNacl 11 | 12 | // MARK: - Utilities 13 | 14 | public struct NaclUtil { 15 | 16 | public enum NaclUtilError: Error { 17 | case badKeySize 18 | case badNonceSize 19 | case badPublicKeySize 20 | case badSecretKeySize 21 | case internalError 22 | } 23 | 24 | static func checkLengths(key: Data, nonce: Data) throws { 25 | if key.count != Constants.Secretbox.keyBytes { 26 | throw NaclUtilError.badKeySize 27 | } 28 | 29 | if nonce.count != Constants.Secretbox.nonceBytes { 30 | throw NaclUtilError.badNonceSize 31 | } 32 | } 33 | 34 | static func checkBoxLength(publicKey: Data, secretKey: Data) throws { 35 | if publicKey.count != Constants.Box.publicKeyBytes { 36 | throw NaclUtilError.badPublicKeySize 37 | } 38 | 39 | if secretKey.count != Constants.Box.secretKeyBytes{ 40 | throw NaclUtilError.badSecretKeySize 41 | } 42 | } 43 | 44 | public static func secureRandomData(count: Int) throws -> Data { 45 | // Generation method is platform dependent 46 | // (The Security framework is only available on Apple platforms). 47 | #if os(Linux) || os(Windows) 48 | 49 | var bytes = [UInt8]() 50 | for _ in 0.. Data { 74 | var hash = Data(count: Constants.Hash.bytes) 75 | let r = hash.withUnsafeMutableBytes { (hashPointer: UnsafeMutablePointer) -> Int32 in 76 | return message.withUnsafeBytes({ (messagePointer: UnsafePointer) -> Int32 in 77 | return CTweetNacl.crypto_hash_sha512_tweet(hashPointer, messagePointer, UInt64(message.count)) 78 | }) 79 | } 80 | 81 | if r != 0 { 82 | throw NaclUtilError.internalError 83 | } 84 | 85 | return hash 86 | } 87 | 88 | public static func verify(x: Data, y: Data) throws -> Bool { 89 | if x.count == 0 || y.count == 0 { 90 | throw NaclUtilError.badKeySize 91 | } 92 | 93 | if x.count != y.count { 94 | throw NaclUtilError.badKeySize 95 | } 96 | 97 | let r = x.withUnsafeBytes { (xPointer: UnsafePointer) -> Int32 in 98 | return y.withUnsafeBytes({ (yPointer: UnsafePointer) -> Int32 in 99 | return CTweetNacl.crypto_verify_32_tweet(xPointer, yPointer) 100 | }) 101 | } 102 | 103 | return r == 0 104 | } 105 | } 106 | 107 | // MARK: - Internal wrapper 108 | 109 | struct NaclWrapper { 110 | enum NaclWrapperError: Error { 111 | case invalidParameters 112 | case internalError 113 | case creationFailed 114 | } 115 | 116 | static func crypto_box_keypair(secretKey sk: Data) throws -> (publicKey: Data, secretKey: Data) { 117 | var pk = Data(count: Constants.Box.secretKeyBytes) 118 | 119 | let result = pk.withUnsafeMutableBytes({ (pkPointer: UnsafeMutablePointer) -> Int32 in 120 | return sk.withUnsafeBytes({ (skPointer: UnsafePointer) -> Int32 in 121 | return CTweetNacl.crypto_scalarmult_curve25519_tweet_base(pkPointer, skPointer) 122 | }) 123 | }) 124 | 125 | if result != 0 { 126 | throw NaclWrapperError.internalError 127 | } 128 | 129 | return (pk, sk) 130 | } 131 | 132 | static func crypto_sign_keypair() throws -> (publicKey: Data, secretKey: Data) { 133 | let sk = try NaclUtil.secureRandomData(count: Constants.Sign.secretKeyBytes) 134 | 135 | return try crypto_sign_keypair_seeded(secretKey: sk) 136 | } 137 | 138 | static func crypto_sign_keypair_seeded(secretKey: Data) throws -> (publicKey: Data, secretKey: Data) { 139 | var pk = Data(count: Constants.Sign.publicKeyBytes) 140 | var sk = Data(count: Constants.Sign.secretKeyBytes) 141 | sk.replaceSubrange(0..) -> Int32 in 144 | return sk.withUnsafeMutableBytes({ (skPointer: UnsafeMutablePointer) -> Int32 in 145 | return CTweetNacl.crypto_sign_ed25519_tweet_keypair(pkPointer, skPointer) 146 | }) 147 | }) 148 | 149 | if result != 0 { 150 | throw NaclWrapperError.internalError 151 | } 152 | 153 | return (pk, sk) 154 | } 155 | } 156 | 157 | // MARK: - Secret-key authenticated encryption 158 | 159 | public struct NaclSecretBox { 160 | public enum NaclSecretBoxError: Error { 161 | case invalidParameters 162 | case internalError 163 | case creationFailed 164 | } 165 | 166 | public static func secretBox(message: Data, nonce: Data, key: Data) throws -> Data { 167 | try NaclUtil.checkLengths(key: key, nonce: nonce) 168 | 169 | var m = Data(count: Constants.Secretbox.zeroBytes + message.count) 170 | m.replaceSubrange(Constants.Secretbox.zeroBytes..) -> Int32 in 175 | return m.withUnsafeBytes({ (mPointer: UnsafePointer) -> Int32 in 176 | return nonce.withUnsafeBytes({ (noncePointer: UnsafePointer) -> Int32 in 177 | return key.withUnsafeBytes({ (keyPointer: UnsafePointer) -> Int32 in 178 | return CTweetNacl.crypto_secretbox_xsalsa20poly1305_tweet(cPointer, mPointer, UInt64(m.count), noncePointer, keyPointer) 179 | }) 180 | }) 181 | }) 182 | } 183 | 184 | if result != 0 { 185 | throw NaclSecretBoxError.internalError 186 | } 187 | return c.subdata(in: Constants.Secretbox.boxZeroBytes.. Data { 191 | try NaclUtil.checkLengths(key: key, nonce: nonce) 192 | 193 | // Fill data 194 | var c = Data(count: Constants.Secretbox.boxZeroBytes + box.count) 195 | c.replaceSubrange(Constants.Secretbox.boxZeroBytes..) -> Int32 in 200 | return c.withUnsafeBytes({ (cPointer: UnsafePointer) -> Int32 in 201 | return nonce.withUnsafeBytes({ (noncePointer: UnsafePointer) -> Int32 in 202 | return key.withUnsafeBytes({ (keyPointer: UnsafePointer) -> Int32 in 203 | return CTweetNacl.crypto_secretbox_xsalsa20poly1305_tweet_open(mPointer, cPointer, UInt64(c.count), noncePointer, keyPointer) 204 | }) 205 | }) 206 | }) 207 | } 208 | 209 | if result != 0 { 210 | throw NaclSecretBoxError.creationFailed 211 | } 212 | 213 | return m.subdata(in: Constants.Secretbox.zeroBytes.. Data { 227 | if n.count != Constants.Scalarmult.scalarBytes { 228 | throw NaclScalarMultError.invalidParameters 229 | } 230 | 231 | if p.count != Constants.Scalarmult.bytes { 232 | throw NaclScalarMultError.invalidParameters 233 | } 234 | 235 | var q = Data(count: Constants.Scalarmult.bytes) 236 | 237 | let result = q.withUnsafeMutableBytes { (qPointer: UnsafeMutablePointer) -> Int32 in 238 | return n.withUnsafeBytes({ (nPointer: UnsafePointer) -> Int32 in 239 | return p.withUnsafeBytes({ (pPointer: UnsafePointer) -> Int32 in 240 | return CTweetNacl.crypto_scalarmult_curve25519_tweet(qPointer, nPointer, pPointer) 241 | }) 242 | }) 243 | } 244 | 245 | if result != 0 { 246 | throw NaclScalarMultError.creationFailed 247 | } 248 | 249 | return q 250 | } 251 | 252 | public static func base(n: Data) throws -> Data { 253 | if n.count != Constants.Scalarmult.scalarBytes { 254 | throw NaclScalarMultError.invalidParameters 255 | } 256 | 257 | var q = Data(count: Constants.Scalarmult.bytes) 258 | 259 | let result = q.withUnsafeMutableBytes { (qPointer: UnsafeMutablePointer) -> Int32 in 260 | return n.withUnsafeBytes({ (nPointer: UnsafePointer) -> Int32 in 261 | return CTweetNacl.crypto_scalarmult_curve25519_tweet_base(qPointer, nPointer) 262 | }) 263 | } 264 | 265 | if result != 0 { 266 | throw NaclScalarMultError.creationFailed 267 | } 268 | 269 | return q 270 | } 271 | } 272 | 273 | // MARK: - Public-key authenticated encryption 274 | 275 | public struct NaclBox { 276 | 277 | public enum NaclBoxError: Error { 278 | case invalidParameters 279 | case internalError 280 | case creationFailed 281 | } 282 | 283 | public static func box(message: Data, nonce: Data, publicKey: Data, secretKey: Data) throws -> Data { 284 | let key = try before(publicKey: publicKey, secretKey: secretKey) 285 | return try NaclSecretBox.secretBox(message: message, nonce: nonce, key: key) 286 | } 287 | 288 | public static func before(publicKey: Data, secretKey: Data) throws -> Data { 289 | try NaclUtil.checkBoxLength(publicKey: publicKey, secretKey: secretKey) 290 | 291 | var k = Data(count: Constants.Box.beforeNMBytes) 292 | 293 | let result = k.withUnsafeMutableBytes { (kPointer: UnsafeMutablePointer) -> Int32 in 294 | return publicKey.withUnsafeBytes({ (pkPointer: UnsafePointer) -> Int32 in 295 | return secretKey.withUnsafeBytes({ (skPointer: UnsafePointer) -> Int32 in 296 | return CTweetNacl.crypto_box_curve25519xsalsa20poly1305_tweet_beforenm(kPointer, pkPointer, skPointer) 297 | }) 298 | }) 299 | } 300 | 301 | if result != 0 { 302 | throw NaclBoxError.creationFailed 303 | } 304 | 305 | return k 306 | } 307 | 308 | public static func open(message: Data, nonce: Data, publicKey: Data, secretKey: Data) throws -> Data { 309 | let k = try before(publicKey: publicKey, secretKey: secretKey) 310 | return try NaclSecretBox.open(box: message, nonce: nonce, key: k) 311 | } 312 | 313 | public static func keyPair() throws -> (publicKey: Data, secretKey: Data) { 314 | let sk = try NaclUtil.secureRandomData(count: Constants.Box.secretKeyBytes) 315 | 316 | return try NaclWrapper.crypto_box_keypair(secretKey: sk) 317 | } 318 | 319 | public static func keyPair(fromSecretKey sk: Data) throws -> (publicKey: Data, secretKey: Data) { 320 | if sk.count != Constants.Box.secretKeyBytes { 321 | throw NaclBoxError.invalidParameters 322 | } 323 | 324 | return try NaclWrapper.crypto_box_keypair(secretKey: sk) 325 | } 326 | } 327 | 328 | // MARK: - Signatures 329 | 330 | public struct NaclSign { 331 | 332 | public enum NaclSignError: Error { 333 | case invalidParameters 334 | case internalError 335 | case creationFailed 336 | } 337 | 338 | public static func sign(message: Data, secretKey: Data) throws -> Data { 339 | if secretKey.count != Constants.Sign.secretKeyBytes{ 340 | throw NaclSignError.invalidParameters 341 | } 342 | 343 | var signedMessage = Data(count: Constants.Sign.bytes + message.count) 344 | 345 | let tmpLength = UnsafeMutablePointer.allocate(capacity: 1) 346 | 347 | let result = signedMessage.withUnsafeMutableBytes { (signedMessagePointer: UnsafeMutablePointer) -> Int32 in 348 | return message.withUnsafeBytes({ (messagePointer: UnsafePointer) -> Int32 in 349 | return secretKey.withUnsafeBytes({ (secretKeyPointer: UnsafePointer) -> Int32 in 350 | return CTweetNacl.crypto_sign_ed25519_tweet(signedMessagePointer, tmpLength, messagePointer, UInt64(message.count), secretKeyPointer) 351 | }) 352 | }) 353 | } 354 | 355 | if result != 0 { 356 | throw NaclSignError.internalError 357 | } 358 | 359 | return signedMessage 360 | } 361 | 362 | public static func signOpen(signedMessage: Data, publicKey: Data) throws -> Data { 363 | if publicKey.count != Constants.Sign.publicKeyBytes { 364 | throw NaclSignError.invalidParameters 365 | } 366 | 367 | var tmp = Data(count: signedMessage.count) 368 | let tmpLength = UnsafeMutablePointer.allocate(capacity: 1) 369 | 370 | let result = tmp.withUnsafeMutableBytes { (tmpPointer: UnsafeMutablePointer) -> Int32 in 371 | return signedMessage.withUnsafeBytes({ (signMessagePointer: UnsafePointer) -> Int32 in 372 | return publicKey.withUnsafeBytes({ (publicKeyPointer: UnsafePointer) -> Int32 in 373 | return CTweetNacl.crypto_sign_ed25519_tweet_open(tmpPointer, tmpLength, signMessagePointer, UInt64(signedMessage.count), publicKeyPointer) 374 | }) 375 | }) 376 | } 377 | 378 | if result != 0 { 379 | throw NaclSignError.creationFailed 380 | } 381 | 382 | return tmp 383 | } 384 | 385 | public static func signDetached(message: Data, secretKey: Data) throws -> Data { 386 | let signedMessage = try sign(message: message, secretKey: secretKey) 387 | 388 | let sig = signedMessage.subdata(in: 0.. Bool { 394 | if sig.count != Constants.Sign.bytes { 395 | throw NaclSignError.invalidParameters 396 | } 397 | 398 | if publicKey.count != Constants.Sign.publicKeyBytes { 399 | throw NaclSignError.invalidParameters 400 | } 401 | 402 | var sm = Data() 403 | 404 | var m = Data(count: Constants.Sign.bytes + message.count) 405 | 406 | sm.append(sig ) 407 | sm.append(message) 408 | 409 | let tmpLength = UnsafeMutablePointer.allocate(capacity: 1) 410 | 411 | let result = m.withUnsafeMutableBytes { (mPointer: UnsafeMutablePointer) -> Int32 in 412 | return sm.withUnsafeBytes({ (smPointer: UnsafePointer) -> Int32 in 413 | return publicKey.withUnsafeBytes({ (publicKeyPointer: UnsafePointer) -> Int32 in 414 | return CTweetNacl.crypto_sign_ed25519_tweet_open(mPointer, tmpLength, smPointer, UInt64(sm.count), publicKeyPointer) 415 | }) 416 | }) 417 | } 418 | 419 | return result == 0 420 | } 421 | 422 | public struct KeyPair { 423 | public static func keyPair() throws -> (publicKey: Data, secretKey: Data) { 424 | return try NaclWrapper.crypto_sign_keypair() 425 | } 426 | 427 | public static func keyPair(fromSecretKey secretKey: Data) throws -> (publicKey: Data, secretKey: Data) { 428 | if secretKey.count != Constants.Sign.secretKeyBytes { 429 | throw NaclSignError.invalidParameters 430 | } 431 | 432 | let pk = secretKey.subdata(in: Constants.Sign.publicKeyBytes.. (publicKey: Data, secretKey: Data) { 438 | if seed.count != Constants.Sign.seedBytes { 439 | throw NaclSignError.invalidParameters 440 | } 441 | 442 | return try NaclWrapper.crypto_sign_keypair_seeded(secretKey: seed) 443 | } 444 | } 445 | } 446 | 447 | -------------------------------------------------------------------------------- /Sources/CTweetNacl/ctweetnacl.c: -------------------------------------------------------------------------------- 1 | #include "ctweetnacl.h" 2 | #define FOR(i,n) for (i = 0;i < n;++i) 3 | #define sv static void 4 | 5 | typedef unsigned char u8; 6 | typedef unsigned long u32; 7 | typedef unsigned long long u64; 8 | typedef long long i64; 9 | typedef i64 gf[16]; 10 | 11 | static const u8 12 | _0[16], 13 | _9[32] = {9}; 14 | static const gf 15 | gf0, 16 | gf1 = {1}, 17 | _121665 = {0xDB41,1}, 18 | D = {0x78a3, 0x1359, 0x4dca, 0x75eb, 0xd8ab, 0x4141, 0x0a4d, 0x0070, 0xe898, 0x7779, 0x4079, 0x8cc7, 0xfe73, 0x2b6f, 0x6cee, 0x5203}, 19 | D2 = {0xf159, 0x26b2, 0x9b94, 0xebd6, 0xb156, 0x8283, 0x149a, 0x00e0, 0xd130, 0xeef3, 0x80f2, 0x198e, 0xfce7, 0x56df, 0xd9dc, 0x2406}, 20 | X = {0xd51a, 0x8f25, 0x2d60, 0xc956, 0xa7b2, 0x9525, 0xc760, 0x692c, 0xdc5c, 0xfdd6, 0xe231, 0xc0a4, 0x53fe, 0xcd6e, 0x36d3, 0x2169}, 21 | Y = {0x6658, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666}, 22 | I = {0xa0b0, 0x4a0e, 0x1b27, 0xc4ee, 0xe478, 0xad2f, 0x1806, 0x2f43, 0xd7a7, 0x3dfb, 0x0099, 0x2b4d, 0xdf0b, 0x4fc1, 0x2480, 0x2b83}; 23 | 24 | static u32 L32(u32 x,int c) { return (x << c) | ((x&0xffffffff) >> (32 - c)); } 25 | 26 | static u32 ld32(const u8 *x) 27 | { 28 | u32 u = x[3]; 29 | u = (u<<8)|x[2]; 30 | u = (u<<8)|x[1]; 31 | return (u<<8)|x[0]; 32 | } 33 | 34 | static u64 dl64(const u8 *x) 35 | { 36 | u64 i,u=0; 37 | FOR(i,8) u=(u<<8)|x[i]; 38 | return u; 39 | } 40 | 41 | sv st32(u8 *x,u32 u) 42 | { 43 | int i; 44 | FOR(i,4) { x[i] = u; u >>= 8; } 45 | } 46 | 47 | sv ts64(u8 *x,u64 u) 48 | { 49 | int i; 50 | for (i = 7;i >= 0;--i) { x[i] = u; u >>= 8; } 51 | } 52 | 53 | static int vn(const u8 *x,const u8 *y,int n) 54 | { 55 | u32 i,d = 0; 56 | FOR(i,n) d |= x[i]^y[i]; 57 | return (1 & ((d - 1) >> 8)) - 1; 58 | } 59 | 60 | int crypto_verify_16(const u8 *x,const u8 *y) 61 | { 62 | return vn(x,y,16); 63 | } 64 | 65 | int crypto_verify_32(const u8 *x,const u8 *y) 66 | { 67 | return vn(x,y,32); 68 | } 69 | 70 | sv core(u8 *out,const u8 *in,const u8 *k,const u8 *c,int h) 71 | { 72 | u32 w[16],x[16],y[16],t[4]; 73 | int i,j,m; 74 | 75 | FOR(i,4) { 76 | x[5*i] = ld32(c+4*i); 77 | x[1+i] = ld32(k+4*i); 78 | x[6+i] = ld32(in+4*i); 79 | x[11+i] = ld32(k+16+4*i); 80 | } 81 | 82 | FOR(i,16) y[i] = x[i]; 83 | 84 | FOR(i,20) { 85 | FOR(j,4) { 86 | FOR(m,4) t[m] = x[(5*j+4*m)%16]; 87 | t[1] ^= L32(t[0]+t[3], 7); 88 | t[2] ^= L32(t[1]+t[0], 9); 89 | t[3] ^= L32(t[2]+t[1],13); 90 | t[0] ^= L32(t[3]+t[2],18); 91 | FOR(m,4) w[4*j+(j+m)%4] = t[m]; 92 | } 93 | FOR(m,16) x[m] = w[m]; 94 | } 95 | 96 | if (h) { 97 | FOR(i,16) x[i] += y[i]; 98 | FOR(i,4) { 99 | x[5*i] -= ld32(c+4*i); 100 | x[6+i] -= ld32(in+4*i); 101 | } 102 | FOR(i,4) { 103 | st32(out+4*i,x[5*i]); 104 | st32(out+16+4*i,x[6+i]); 105 | } 106 | } else 107 | FOR(i,16) st32(out + 4 * i,x[i] + y[i]); 108 | } 109 | 110 | int crypto_core_salsa20(u8 *out,const u8 *in,const u8 *k,const u8 *c) 111 | { 112 | core(out,in,k,c,0); 113 | return 0; 114 | } 115 | 116 | int crypto_core_hsalsa20(u8 *out,const u8 *in,const u8 *k,const u8 *c) 117 | { 118 | core(out,in,k,c,1); 119 | return 0; 120 | } 121 | 122 | static const u8 sigma[16] = "expand 32-byte k"; 123 | 124 | int crypto_stream_salsa20_xor(u8 *c,const u8 *m,u64 b,const u8 *n,const u8 *k) 125 | { 126 | u8 z[16],x[64]; 127 | u32 u,i; 128 | if (!b) return 0; 129 | FOR(i,16) z[i] = 0; 130 | FOR(i,8) z[i] = n[i]; 131 | while (b >= 64) { 132 | crypto_core_salsa20(x,z,k,sigma); 133 | FOR(i,64) c[i] = (m?m[i]:0) ^ x[i]; 134 | u = 1; 135 | for (i = 8;i < 16;++i) { 136 | u += (u32) z[i]; 137 | z[i] = u; 138 | u >>= 8; 139 | } 140 | b -= 64; 141 | c += 64; 142 | if (m) m += 64; 143 | } 144 | if (b) { 145 | crypto_core_salsa20(x,z,k,sigma); 146 | FOR(i,b) c[i] = (m?m[i]:0) ^ x[i]; 147 | } 148 | return 0; 149 | } 150 | 151 | int crypto_stream_salsa20(u8 *c,u64 d,const u8 *n,const u8 *k) 152 | { 153 | return crypto_stream_salsa20_xor(c,0,d,n,k); 154 | } 155 | 156 | int crypto_stream(u8 *c,u64 d,const u8 *n,const u8 *k) 157 | { 158 | u8 s[32]; 159 | crypto_core_hsalsa20(s,n,k,sigma); 160 | return crypto_stream_salsa20(c,d,n+16,s); 161 | } 162 | 163 | int crypto_stream_xor(u8 *c,const u8 *m,u64 d,const u8 *n,const u8 *k) 164 | { 165 | u8 s[32]; 166 | crypto_core_hsalsa20(s,n,k,sigma); 167 | return crypto_stream_salsa20_xor(c,m,d,n+16,s); 168 | } 169 | 170 | sv add1305(u32 *h,const u32 *c) 171 | { 172 | u32 j,u = 0; 173 | FOR(j,17) { 174 | u += h[j] + c[j]; 175 | h[j] = u & 255; 176 | u >>= 8; 177 | } 178 | } 179 | 180 | static const u32 minusp[17] = { 181 | 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 252 182 | } ; 183 | 184 | int crypto_onetimeauth(u8 *out,const u8 *m,u64 n,const u8 *k) 185 | { 186 | u32 s,i,j,u,x[17],r[17],h[17],c[17],g[17]; 187 | 188 | FOR(j,17) r[j]=h[j]=0; 189 | FOR(j,16) r[j]=k[j]; 190 | r[3]&=15; 191 | r[4]&=252; 192 | r[7]&=15; 193 | r[8]&=252; 194 | r[11]&=15; 195 | r[12]&=252; 196 | r[15]&=15; 197 | 198 | while (n > 0) { 199 | FOR(j,17) c[j] = 0; 200 | for (j = 0;(j < 16) && (j < n);++j) c[j] = m[j]; 201 | c[j] = 1; 202 | m += j; n -= j; 203 | add1305(h,c); 204 | FOR(i,17) { 205 | x[i] = 0; 206 | FOR(j,17) x[i] += h[j] * ((j <= i) ? r[i - j] : 320 * r[i + 17 - j]); 207 | } 208 | FOR(i,17) h[i] = x[i]; 209 | u = 0; 210 | FOR(j,16) { 211 | u += h[j]; 212 | h[j] = u & 255; 213 | u >>= 8; 214 | } 215 | u += h[16]; h[16] = u & 3; 216 | u = 5 * (u >> 2); 217 | FOR(j,16) { 218 | u += h[j]; 219 | h[j] = u & 255; 220 | u >>= 8; 221 | } 222 | u += h[16]; h[16] = u; 223 | } 224 | 225 | FOR(j,17) g[j] = h[j]; 226 | add1305(h,minusp); 227 | s = -(h[16] >> 7); 228 | FOR(j,17) h[j] ^= s & (g[j] ^ h[j]); 229 | 230 | FOR(j,16) c[j] = k[j + 16]; 231 | c[16] = 0; 232 | add1305(h,c); 233 | FOR(j,16) out[j] = h[j]; 234 | return 0; 235 | } 236 | 237 | int crypto_onetimeauth_verify(const u8 *h,const u8 *m,u64 n,const u8 *k) 238 | { 239 | u8 x[16]; 240 | crypto_onetimeauth(x,m,n,k); 241 | return crypto_verify_16(h,x); 242 | } 243 | 244 | int crypto_secretbox(u8 *c,const u8 *m,u64 d,const u8 *n,const u8 *k) 245 | { 246 | int i; 247 | if (d < 32) return -1; 248 | crypto_stream_xor(c,m,d,n,k); 249 | crypto_onetimeauth(c + 16,c + 32,d - 32,c); 250 | FOR(i,16) c[i] = 0; 251 | return 0; 252 | } 253 | 254 | int crypto_secretbox_open(u8 *m,const u8 *c,u64 d,const u8 *n,const u8 *k) 255 | { 256 | int i; 257 | u8 x[32]; 258 | if (d < 32) return -1; 259 | crypto_stream(x,32,n,k); 260 | if (crypto_onetimeauth_verify(c + 16,c + 32,d - 32,x) != 0) return -1; 261 | crypto_stream_xor(m,c,d,n,k); 262 | FOR(i,32) m[i] = 0; 263 | return 0; 264 | } 265 | 266 | sv set25519(gf r, const gf a) 267 | { 268 | int i; 269 | FOR(i,16) r[i]=a[i]; 270 | } 271 | 272 | sv car25519(gf o) 273 | { 274 | int i; 275 | i64 c; 276 | FOR(i,16) { 277 | o[i]+=(1LL<<16); 278 | c=o[i]>>16; 279 | o[(i+1)*(i<15)]+=c-1+37*(c-1)*(i==15); 280 | o[i]-=c<<16; 281 | } 282 | } 283 | 284 | sv sel25519(gf p,gf q,int b) 285 | { 286 | i64 t,i,c=~(b-1); 287 | FOR(i,16) { 288 | t= c&(p[i]^q[i]); 289 | p[i]^=t; 290 | q[i]^=t; 291 | } 292 | } 293 | 294 | sv pack25519(u8 *o,const gf n) 295 | { 296 | int i,j,b; 297 | gf m,t; 298 | FOR(i,16) t[i]=n[i]; 299 | car25519(t); 300 | car25519(t); 301 | car25519(t); 302 | FOR(j,2) { 303 | m[0]=t[0]-0xffed; 304 | for(i=1;i<15;i++) { 305 | m[i]=t[i]-0xffff-((m[i-1]>>16)&1); 306 | m[i-1]&=0xffff; 307 | } 308 | m[15]=t[15]-0x7fff-((m[14]>>16)&1); 309 | b=(m[15]>>16)&1; 310 | m[14]&=0xffff; 311 | sel25519(t,m,1-b); 312 | } 313 | FOR(i,16) { 314 | o[2*i]=t[i]&0xff; 315 | o[2*i+1]=t[i]>>8; 316 | } 317 | } 318 | 319 | static int neq25519(const gf a, const gf b) 320 | { 321 | u8 c[32],d[32]; 322 | pack25519(c,a); 323 | pack25519(d,b); 324 | return crypto_verify_32(c,d); 325 | } 326 | 327 | static u8 par25519(const gf a) 328 | { 329 | u8 d[32]; 330 | pack25519(d,a); 331 | return d[0]&1; 332 | } 333 | 334 | sv unpack25519(gf o, const u8 *n) 335 | { 336 | int i; 337 | FOR(i,16) o[i]=n[2*i]+((i64)n[2*i+1]<<8); 338 | o[15]&=0x7fff; 339 | } 340 | 341 | sv A(gf o,const gf a,const gf b) 342 | { 343 | int i; 344 | FOR(i,16) o[i]=a[i]+b[i]; 345 | } 346 | 347 | sv Z(gf o,const gf a,const gf b) 348 | { 349 | int i; 350 | FOR(i,16) o[i]=a[i]-b[i]; 351 | } 352 | 353 | sv M(gf o,const gf a,const gf b) 354 | { 355 | i64 i,j,t[31]; 356 | FOR(i,31) t[i]=0; 357 | FOR(i,16) FOR(j,16) t[i+j]+=a[i]*b[j]; 358 | FOR(i,15) t[i]+=38*t[i+16]; 359 | FOR(i,16) o[i]=t[i]; 360 | car25519(o); 361 | car25519(o); 362 | } 363 | 364 | sv S(gf o,const gf a) 365 | { 366 | M(o,a,a); 367 | } 368 | 369 | sv inv25519(gf o,const gf i) 370 | { 371 | gf c; 372 | int a; 373 | FOR(a,16) c[a]=i[a]; 374 | for(a=253;a>=0;a--) { 375 | S(c,c); 376 | if(a!=2&&a!=4) M(c,c,i); 377 | } 378 | FOR(a,16) o[a]=c[a]; 379 | } 380 | 381 | sv pow2523(gf o,const gf i) 382 | { 383 | gf c; 384 | int a; 385 | FOR(a,16) c[a]=i[a]; 386 | for(a=250;a>=0;a--) { 387 | S(c,c); 388 | if(a!=1) M(c,c,i); 389 | } 390 | FOR(a,16) o[a]=c[a]; 391 | } 392 | 393 | int crypto_scalarmult(u8 *q,const u8 *n,const u8 *p) 394 | { 395 | u8 z[32]; 396 | i64 x[80],r,i; 397 | gf a,b,c,d,e,f; 398 | FOR(i,31) z[i]=n[i]; 399 | z[31]=(n[31]&127)|64; 400 | z[0]&=248; 401 | unpack25519(x,p); 402 | FOR(i,16) { 403 | b[i]=x[i]; 404 | d[i]=a[i]=c[i]=0; 405 | } 406 | a[0]=d[0]=1; 407 | for(i=254;i>=0;--i) { 408 | r=(z[i>>3]>>(i&7))&1; 409 | sel25519(a,b,r); 410 | sel25519(c,d,r); 411 | A(e,a,c); 412 | Z(a,a,c); 413 | A(c,b,d); 414 | Z(b,b,d); 415 | S(d,e); 416 | S(f,a); 417 | M(a,c,a); 418 | M(c,b,e); 419 | A(e,a,c); 420 | Z(a,a,c); 421 | S(b,a); 422 | Z(c,d,f); 423 | M(a,c,_121665); 424 | A(a,a,d); 425 | M(c,c,a); 426 | M(a,d,f); 427 | M(d,b,x); 428 | S(b,e); 429 | sel25519(a,b,r); 430 | sel25519(c,d,r); 431 | } 432 | FOR(i,16) { 433 | x[i+16]=a[i]; 434 | x[i+32]=c[i]; 435 | x[i+48]=b[i]; 436 | x[i+64]=d[i]; 437 | } 438 | inv25519(x+32,x+32); 439 | M(x+16,x+16,x+32); 440 | pack25519(q,x+16); 441 | return 0; 442 | } 443 | 444 | int crypto_scalarmult_base(u8 *q,const u8 *n) 445 | { 446 | return crypto_scalarmult(q,n,_9); 447 | } 448 | 449 | //int crypto_box_keypair(u8 *y,u8 *x) 450 | //{ 451 | // randombytes(x,32); 452 | // return crypto_scalarmult_base(y,x); 453 | //} 454 | 455 | int crypto_box_beforenm(u8 *k,const u8 *y,const u8 *x) 456 | { 457 | u8 s[32]; 458 | crypto_scalarmult(s,x,y); 459 | return crypto_core_hsalsa20(k,_0,s,sigma); 460 | } 461 | 462 | int crypto_box_afternm(u8 *c,const u8 *m,u64 d,const u8 *n,const u8 *k) 463 | { 464 | return crypto_secretbox(c,m,d,n,k); 465 | } 466 | 467 | int crypto_box_open_afternm(u8 *m,const u8 *c,u64 d,const u8 *n,const u8 *k) 468 | { 469 | return crypto_secretbox_open(m,c,d,n,k); 470 | } 471 | 472 | int crypto_box(u8 *c,const u8 *m,u64 d,const u8 *n,const u8 *y,const u8 *x) 473 | { 474 | u8 k[32]; 475 | crypto_box_beforenm(k,y,x); 476 | return crypto_box_afternm(c,m,d,n,k); 477 | } 478 | 479 | int crypto_box_open(u8 *m,const u8 *c,u64 d,const u8 *n,const u8 *y,const u8 *x) 480 | { 481 | u8 k[32]; 482 | crypto_box_beforenm(k,y,x); 483 | return crypto_box_open_afternm(m,c,d,n,k); 484 | } 485 | 486 | static u64 R(u64 x,int c) { return (x >> c) | (x << (64 - c)); } 487 | static u64 Ch(u64 x,u64 y,u64 z) { return (x & y) ^ (~x & z); } 488 | static u64 Maj(u64 x,u64 y,u64 z) { return (x & y) ^ (x & z) ^ (y & z); } 489 | static u64 Sigma0(u64 x) { return R(x,28) ^ R(x,34) ^ R(x,39); } 490 | static u64 Sigma1(u64 x) { return R(x,14) ^ R(x,18) ^ R(x,41); } 491 | static u64 sigma0(u64 x) { return R(x, 1) ^ R(x, 8) ^ (x >> 7); } 492 | static u64 sigma1(u64 x) { return R(x,19) ^ R(x,61) ^ (x >> 6); } 493 | 494 | static const u64 K[80] = 495 | { 496 | 0x428a2f98d728ae22ULL, 0x7137449123ef65cdULL, 0xb5c0fbcfec4d3b2fULL, 0xe9b5dba58189dbbcULL, 497 | 0x3956c25bf348b538ULL, 0x59f111f1b605d019ULL, 0x923f82a4af194f9bULL, 0xab1c5ed5da6d8118ULL, 498 | 0xd807aa98a3030242ULL, 0x12835b0145706fbeULL, 0x243185be4ee4b28cULL, 0x550c7dc3d5ffb4e2ULL, 499 | 0x72be5d74f27b896fULL, 0x80deb1fe3b1696b1ULL, 0x9bdc06a725c71235ULL, 0xc19bf174cf692694ULL, 500 | 0xe49b69c19ef14ad2ULL, 0xefbe4786384f25e3ULL, 0x0fc19dc68b8cd5b5ULL, 0x240ca1cc77ac9c65ULL, 501 | 0x2de92c6f592b0275ULL, 0x4a7484aa6ea6e483ULL, 0x5cb0a9dcbd41fbd4ULL, 0x76f988da831153b5ULL, 502 | 0x983e5152ee66dfabULL, 0xa831c66d2db43210ULL, 0xb00327c898fb213fULL, 0xbf597fc7beef0ee4ULL, 503 | 0xc6e00bf33da88fc2ULL, 0xd5a79147930aa725ULL, 0x06ca6351e003826fULL, 0x142929670a0e6e70ULL, 504 | 0x27b70a8546d22ffcULL, 0x2e1b21385c26c926ULL, 0x4d2c6dfc5ac42aedULL, 0x53380d139d95b3dfULL, 505 | 0x650a73548baf63deULL, 0x766a0abb3c77b2a8ULL, 0x81c2c92e47edaee6ULL, 0x92722c851482353bULL, 506 | 0xa2bfe8a14cf10364ULL, 0xa81a664bbc423001ULL, 0xc24b8b70d0f89791ULL, 0xc76c51a30654be30ULL, 507 | 0xd192e819d6ef5218ULL, 0xd69906245565a910ULL, 0xf40e35855771202aULL, 0x106aa07032bbd1b8ULL, 508 | 0x19a4c116b8d2d0c8ULL, 0x1e376c085141ab53ULL, 0x2748774cdf8eeb99ULL, 0x34b0bcb5e19b48a8ULL, 509 | 0x391c0cb3c5c95a63ULL, 0x4ed8aa4ae3418acbULL, 0x5b9cca4f7763e373ULL, 0x682e6ff3d6b2b8a3ULL, 510 | 0x748f82ee5defb2fcULL, 0x78a5636f43172f60ULL, 0x84c87814a1f0ab72ULL, 0x8cc702081a6439ecULL, 511 | 0x90befffa23631e28ULL, 0xa4506cebde82bde9ULL, 0xbef9a3f7b2c67915ULL, 0xc67178f2e372532bULL, 512 | 0xca273eceea26619cULL, 0xd186b8c721c0c207ULL, 0xeada7dd6cde0eb1eULL, 0xf57d4f7fee6ed178ULL, 513 | 0x06f067aa72176fbaULL, 0x0a637dc5a2c898a6ULL, 0x113f9804bef90daeULL, 0x1b710b35131c471bULL, 514 | 0x28db77f523047d84ULL, 0x32caab7b40c72493ULL, 0x3c9ebe0a15c9bebcULL, 0x431d67c49c100d4cULL, 515 | 0x4cc5d4becb3e42b6ULL, 0x597f299cfc657e2aULL, 0x5fcb6fab3ad6faecULL, 0x6c44198c4a475817ULL 516 | }; 517 | 518 | int crypto_hashblocks(u8 *x,const u8 *m,u64 n) 519 | { 520 | u64 z[8],b[8],a[8],w[16],t; 521 | int i,j; 522 | 523 | FOR(i,8) z[i] = a[i] = dl64(x + 8 * i); 524 | 525 | while (n >= 128) { 526 | FOR(i,16) w[i] = dl64(m + 8 * i); 527 | 528 | FOR(i,80) { 529 | FOR(j,8) b[j] = a[j]; 530 | t = a[7] + Sigma1(a[4]) + Ch(a[4],a[5],a[6]) + K[i] + w[i%16]; 531 | b[7] = t + Sigma0(a[0]) + Maj(a[0],a[1],a[2]); 532 | b[3] += t; 533 | FOR(j,8) a[(j+1)%8] = b[j]; 534 | if (i%16 == 15) 535 | FOR(j,16) 536 | w[j] += w[(j+9)%16] + sigma0(w[(j+1)%16]) + sigma1(w[(j+14)%16]); 537 | } 538 | 539 | FOR(i,8) { a[i] += z[i]; z[i] = a[i]; } 540 | 541 | m += 128; 542 | n -= 128; 543 | } 544 | 545 | FOR(i,8) ts64(x+8*i,z[i]); 546 | 547 | return n; 548 | } 549 | 550 | static const u8 iv[64] = { 551 | 0x6a,0x09,0xe6,0x67,0xf3,0xbc,0xc9,0x08, 552 | 0xbb,0x67,0xae,0x85,0x84,0xca,0xa7,0x3b, 553 | 0x3c,0x6e,0xf3,0x72,0xfe,0x94,0xf8,0x2b, 554 | 0xa5,0x4f,0xf5,0x3a,0x5f,0x1d,0x36,0xf1, 555 | 0x51,0x0e,0x52,0x7f,0xad,0xe6,0x82,0xd1, 556 | 0x9b,0x05,0x68,0x8c,0x2b,0x3e,0x6c,0x1f, 557 | 0x1f,0x83,0xd9,0xab,0xfb,0x41,0xbd,0x6b, 558 | 0x5b,0xe0,0xcd,0x19,0x13,0x7e,0x21,0x79 559 | } ; 560 | 561 | int crypto_hash(u8 *out,const u8 *m,u64 n) 562 | { 563 | u8 h[64],x[256]; 564 | u64 i,b = n; 565 | 566 | FOR(i,64) h[i] = iv[i]; 567 | 568 | crypto_hashblocks(h,m,n); 569 | m += n; 570 | n &= 127; 571 | m -= n; 572 | 573 | FOR(i,256) x[i] = 0; 574 | FOR(i,n) x[i] = m[i]; 575 | x[n] = 128; 576 | 577 | n = 256-128*(n<112); 578 | x[n-9] = b >> 61; 579 | ts64(x+n-8,b<<3); 580 | crypto_hashblocks(h,x,n); 581 | 582 | FOR(i,64) out[i] = h[i]; 583 | 584 | return 0; 585 | } 586 | 587 | sv add(gf p[4],gf q[4]) 588 | { 589 | gf a,b,c,d,t,e,f,g,h; 590 | 591 | Z(a, p[1], p[0]); 592 | Z(t, q[1], q[0]); 593 | M(a, a, t); 594 | A(b, p[0], p[1]); 595 | A(t, q[0], q[1]); 596 | M(b, b, t); 597 | M(c, p[3], q[3]); 598 | M(c, c, D2); 599 | M(d, p[2], q[2]); 600 | A(d, d, d); 601 | Z(e, b, a); 602 | Z(f, d, c); 603 | A(g, d, c); 604 | A(h, b, a); 605 | 606 | M(p[0], e, f); 607 | M(p[1], h, g); 608 | M(p[2], g, f); 609 | M(p[3], e, h); 610 | } 611 | 612 | sv cswap(gf p[4],gf q[4],u8 b) 613 | { 614 | int i; 615 | FOR(i,4) 616 | sel25519(p[i],q[i],b); 617 | } 618 | 619 | sv pack(u8 *r,gf p[4]) 620 | { 621 | gf tx, ty, zi; 622 | inv25519(zi, p[2]); 623 | M(tx, p[0], zi); 624 | M(ty, p[1], zi); 625 | pack25519(r, ty); 626 | r[31] ^= par25519(tx) << 7; 627 | } 628 | 629 | sv scalarmult(gf p[4],gf q[4],const u8 *s) 630 | { 631 | int i; 632 | set25519(p[0],gf0); 633 | set25519(p[1],gf1); 634 | set25519(p[2],gf1); 635 | set25519(p[3],gf0); 636 | for (i = 255;i >= 0;--i) { 637 | u8 b = (s[i/8]>>(i&7))&1; 638 | cswap(p,q,b); 639 | add(q,p); 640 | add(p,p); 641 | cswap(p,q,b); 642 | } 643 | } 644 | 645 | sv scalarbase(gf p[4],const u8 *s) 646 | { 647 | gf q[4]; 648 | set25519(q[0],X); 649 | set25519(q[1],Y); 650 | set25519(q[2],gf1); 651 | M(q[3],X,Y); 652 | scalarmult(p,q,s); 653 | } 654 | 655 | int crypto_sign_keypair(u8 *pk, u8 *sk) 656 | { 657 | u8 d[64]; 658 | gf p[4]; 659 | int i; 660 | 661 | crypto_hash(d, sk, 32); 662 | d[0] &= 248; 663 | d[31] &= 127; 664 | d[31] |= 64; 665 | 666 | scalarbase(p,d); 667 | pack(pk,p); 668 | 669 | FOR(i,32) sk[32 + i] = pk[i]; 670 | return 0; 671 | } 672 | 673 | static const u64 L[32] = {0xed, 0xd3, 0xf5, 0x5c, 0x1a, 0x63, 0x12, 0x58, 0xd6, 0x9c, 0xf7, 0xa2, 0xde, 0xf9, 0xde, 0x14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x10}; 674 | 675 | sv modL(u8 *r,i64 x[64]) 676 | { 677 | i64 carry,i,j; 678 | for (i = 63;i >= 32;--i) { 679 | carry = 0; 680 | for (j = i - 32;j < i - 12;++j) { 681 | x[j] += carry - 16 * x[i] * L[j - (i - 32)]; 682 | carry = (x[j] + 128) >> 8; 683 | x[j] -= carry << 8; 684 | } 685 | x[j] += carry; 686 | x[i] = 0; 687 | } 688 | carry = 0; 689 | FOR(j,32) { 690 | x[j] += carry - (x[31] >> 4) * L[j]; 691 | carry = x[j] >> 8; 692 | x[j] &= 255; 693 | } 694 | FOR(j,32) x[j] -= carry * L[j]; 695 | FOR(i,32) { 696 | x[i+1] += x[i] >> 8; 697 | r[i] = x[i] & 255; 698 | } 699 | } 700 | 701 | sv reduce(u8 *r) 702 | { 703 | i64 x[64],i; 704 | FOR(i,64) x[i] = (u64) r[i]; 705 | FOR(i,64) r[i] = 0; 706 | modL(r,x); 707 | } 708 | 709 | int crypto_sign(u8 *sm,u64 *smlen,const u8 *m,u64 n,const u8 *sk) 710 | { 711 | u8 d[64],h[64],r[64]; 712 | i64 i,j,x[64]; 713 | gf p[4]; 714 | 715 | crypto_hash(d, sk, 32); 716 | d[0] &= 248; 717 | d[31] &= 127; 718 | d[31] |= 64; 719 | 720 | *smlen = n+64; 721 | FOR(i,n) sm[64 + i] = m[i]; 722 | FOR(i,32) sm[32 + i] = d[32 + i]; 723 | 724 | crypto_hash(r, sm+32, n+32); 725 | reduce(r); 726 | scalarbase(p,r); 727 | pack(sm,p); 728 | 729 | FOR(i,32) sm[i+32] = sk[i+32]; 730 | crypto_hash(h,sm,n + 64); 731 | reduce(h); 732 | 733 | FOR(i,64) x[i] = 0; 734 | FOR(i,32) x[i] = (u64) r[i]; 735 | FOR(i,32) FOR(j,32) x[i+j] += h[i] * (u64) d[j]; 736 | modL(sm + 32,x); 737 | 738 | return 0; 739 | } 740 | 741 | static int unpackneg(gf r[4],const u8 p[32]) 742 | { 743 | gf t, chk, num, den, den2, den4, den6; 744 | set25519(r[2],gf1); 745 | unpack25519(r[1],p); 746 | S(num,r[1]); 747 | M(den,num,D); 748 | Z(num,num,r[2]); 749 | A(den,r[2],den); 750 | 751 | S(den2,den); 752 | S(den4,den2); 753 | M(den6,den4,den2); 754 | M(t,den6,num); 755 | M(t,t,den); 756 | 757 | pow2523(t,t); 758 | M(t,t,num); 759 | M(t,t,den); 760 | M(t,t,den); 761 | M(r[0],t,den); 762 | 763 | S(chk,r[0]); 764 | M(chk,chk,den); 765 | if (neq25519(chk, num)) M(r[0],r[0],I); 766 | 767 | S(chk,r[0]); 768 | M(chk,chk,den); 769 | if (neq25519(chk, num)) return -1; 770 | 771 | if (par25519(r[0]) == (p[31]>>7)) Z(r[0],gf0,r[0]); 772 | 773 | M(r[3],r[0],r[1]); 774 | return 0; 775 | } 776 | 777 | int crypto_sign_open(u8 *m,u64 *mlen,const u8 *sm,u64 n,const u8 *pk) 778 | { 779 | int i; 780 | u8 t[32],h[64]; 781 | gf p[4],q[4]; 782 | 783 | *mlen = -1; 784 | if (n < 64) return -1; 785 | 786 | if (unpackneg(q,pk)) return -1; 787 | 788 | FOR(i,n) m[i] = sm[i]; 789 | FOR(i,32) m[i+32] = pk[i]; 790 | crypto_hash(h,m,n); 791 | reduce(h); 792 | scalarmult(p,q,h); 793 | 794 | scalarbase(q,sm + 32); 795 | add(p,q); 796 | pack(t,p); 797 | 798 | n -= 64; 799 | if (crypto_verify_32(sm, t)) { 800 | FOR(i,n) m[i] = 0; 801 | return -1; 802 | } 803 | 804 | FOR(i,n) m[i] = sm[i + 64]; 805 | *mlen = n; 806 | return 0; 807 | } 808 | -------------------------------------------------------------------------------- /Sources/CTweetNacl/include/ctweetnacl.h: -------------------------------------------------------------------------------- 1 | #ifndef TWEETNACL_H 2 | #define TWEETNACL_H 3 | #define crypto_auth_PRIMITIVE "hmacsha512256" 4 | #define crypto_auth crypto_auth_hmacsha512256 5 | #define crypto_auth_verify crypto_auth_hmacsha512256_verify 6 | #define crypto_auth_BYTES crypto_auth_hmacsha512256_BYTES 7 | #define crypto_auth_KEYBYTES crypto_auth_hmacsha512256_KEYBYTES 8 | #define crypto_auth_IMPLEMENTATION crypto_auth_hmacsha512256_IMPLEMENTATION 9 | #define crypto_auth_VERSION crypto_auth_hmacsha512256_VERSION 10 | #define crypto_auth_hmacsha512256_tweet_BYTES 32 11 | #define crypto_auth_hmacsha512256_tweet_KEYBYTES 32 12 | extern int crypto_auth_hmacsha512256_tweet(unsigned char *,const unsigned char *,unsigned long long,const unsigned char *); 13 | extern int crypto_auth_hmacsha512256_tweet_verify(const unsigned char *,const unsigned char *,unsigned long long,const unsigned char *); 14 | #define crypto_auth_hmacsha512256_tweet_VERSION "-" 15 | #define crypto_auth_hmacsha512256 crypto_auth_hmacsha512256_tweet 16 | #define crypto_auth_hmacsha512256_verify crypto_auth_hmacsha512256_tweet_verify 17 | #define crypto_auth_hmacsha512256_BYTES crypto_auth_hmacsha512256_tweet_BYTES 18 | #define crypto_auth_hmacsha512256_KEYBYTES crypto_auth_hmacsha512256_tweet_KEYBYTES 19 | #define crypto_auth_hmacsha512256_VERSION crypto_auth_hmacsha512256_tweet_VERSION 20 | #define crypto_auth_hmacsha512256_IMPLEMENTATION "crypto_auth/hmacsha512256/tweet" 21 | #define crypto_box_PRIMITIVE "curve25519xsalsa20poly1305" 22 | #define crypto_box crypto_box_curve25519xsalsa20poly1305 23 | #define crypto_box_open crypto_box_curve25519xsalsa20poly1305_open 24 | //#define crypto_box_keypair crypto_box_curve25519xsalsa20poly1305_keypair 25 | #define crypto_box_beforenm crypto_box_curve25519xsalsa20poly1305_beforenm 26 | #define crypto_box_afternm crypto_box_curve25519xsalsa20poly1305_afternm 27 | #define crypto_box_open_afternm crypto_box_curve25519xsalsa20poly1305_open_afternm 28 | #define crypto_box_PUBLICKEYBYTES crypto_box_curve25519xsalsa20poly1305_PUBLICKEYBYTES 29 | #define crypto_box_SECRETKEYBYTES crypto_box_curve25519xsalsa20poly1305_SECRETKEYBYTES 30 | #define crypto_box_BEFORENMBYTES crypto_box_curve25519xsalsa20poly1305_BEFORENMBYTES 31 | #define crypto_box_NONCEBYTES crypto_box_curve25519xsalsa20poly1305_NONCEBYTES 32 | #define crypto_box_ZEROBYTES crypto_box_curve25519xsalsa20poly1305_ZEROBYTES 33 | #define crypto_box_BOXZEROBYTES crypto_box_curve25519xsalsa20poly1305_BOXZEROBYTES 34 | #define crypto_box_IMPLEMENTATION crypto_box_curve25519xsalsa20poly1305_IMPLEMENTATION 35 | #define crypto_box_VERSION crypto_box_curve25519xsalsa20poly1305_VERSION 36 | #define crypto_box_curve25519xsalsa20poly1305_tweet_PUBLICKEYBYTES 32 37 | #define crypto_box_curve25519xsalsa20poly1305_tweet_SECRETKEYBYTES 32 38 | #define crypto_box_curve25519xsalsa20poly1305_tweet_BEFORENMBYTES 32 39 | #define crypto_box_curve25519xsalsa20poly1305_tweet_NONCEBYTES 24 40 | #define crypto_box_curve25519xsalsa20poly1305_tweet_ZEROBYTES 32 41 | #define crypto_box_curve25519xsalsa20poly1305_tweet_BOXZEROBYTES 16 42 | extern int crypto_box_curve25519xsalsa20poly1305_tweet(unsigned char *,const unsigned char *,unsigned long long,const unsigned char *,const unsigned char *,const unsigned char *); 43 | extern int crypto_box_curve25519xsalsa20poly1305_tweet_open(unsigned char *,const unsigned char *,unsigned long long,const unsigned char *,const unsigned char *,const unsigned char *); 44 | extern int crypto_box_curve25519xsalsa20poly1305_tweet_keypair(unsigned char *,unsigned char *); 45 | extern int crypto_box_curve25519xsalsa20poly1305_tweet_beforenm(unsigned char *,const unsigned char *,const unsigned char *); 46 | extern int crypto_box_curve25519xsalsa20poly1305_tweet_afternm(unsigned char *,const unsigned char *,unsigned long long,const unsigned char *,const unsigned char *); 47 | extern int crypto_box_curve25519xsalsa20poly1305_tweet_open_afternm(unsigned char *,const unsigned char *,unsigned long long,const unsigned char *,const unsigned char *); 48 | #define crypto_box_curve25519xsalsa20poly1305_tweet_VERSION "-" 49 | #define crypto_box_curve25519xsalsa20poly1305 crypto_box_curve25519xsalsa20poly1305_tweet 50 | #define crypto_box_curve25519xsalsa20poly1305_open crypto_box_curve25519xsalsa20poly1305_tweet_open 51 | //#define crypto_box_curve25519xsalsa20poly1305_keypair crypto_box_curve25519xsalsa20poly1305_tweet_keypair 52 | #define crypto_box_curve25519xsalsa20poly1305_beforenm crypto_box_curve25519xsalsa20poly1305_tweet_beforenm 53 | #define crypto_box_curve25519xsalsa20poly1305_afternm crypto_box_curve25519xsalsa20poly1305_tweet_afternm 54 | #define crypto_box_curve25519xsalsa20poly1305_open_afternm crypto_box_curve25519xsalsa20poly1305_tweet_open_afternm 55 | #define crypto_box_curve25519xsalsa20poly1305_PUBLICKEYBYTES crypto_box_curve25519xsalsa20poly1305_tweet_PUBLICKEYBYTES 56 | #define crypto_box_curve25519xsalsa20poly1305_SECRETKEYBYTES crypto_box_curve25519xsalsa20poly1305_tweet_SECRETKEYBYTES 57 | #define crypto_box_curve25519xsalsa20poly1305_BEFORENMBYTES crypto_box_curve25519xsalsa20poly1305_tweet_BEFORENMBYTES 58 | #define crypto_box_curve25519xsalsa20poly1305_NONCEBYTES crypto_box_curve25519xsalsa20poly1305_tweet_NONCEBYTES 59 | #define crypto_box_curve25519xsalsa20poly1305_ZEROBYTES crypto_box_curve25519xsalsa20poly1305_tweet_ZEROBYTES 60 | #define crypto_box_curve25519xsalsa20poly1305_BOXZEROBYTES crypto_box_curve25519xsalsa20poly1305_tweet_BOXZEROBYTES 61 | #define crypto_box_curve25519xsalsa20poly1305_VERSION crypto_box_curve25519xsalsa20poly1305_tweet_VERSION 62 | #define crypto_box_curve25519xsalsa20poly1305_IMPLEMENTATION "crypto_box/curve25519xsalsa20poly1305/tweet" 63 | #define crypto_core_PRIMITIVE "salsa20" 64 | #define crypto_core crypto_core_salsa20 65 | #define crypto_core_OUTPUTBYTES crypto_core_salsa20_OUTPUTBYTES 66 | #define crypto_core_INPUTBYTES crypto_core_salsa20_INPUTBYTES 67 | #define crypto_core_KEYBYTES crypto_core_salsa20_KEYBYTES 68 | #define crypto_core_CONSTBYTES crypto_core_salsa20_CONSTBYTES 69 | #define crypto_core_IMPLEMENTATION crypto_core_salsa20_IMPLEMENTATION 70 | #define crypto_core_VERSION crypto_core_salsa20_VERSION 71 | #define crypto_core_salsa20_tweet_OUTPUTBYTES 64 72 | #define crypto_core_salsa20_tweet_INPUTBYTES 16 73 | #define crypto_core_salsa20_tweet_KEYBYTES 32 74 | #define crypto_core_salsa20_tweet_CONSTBYTES 16 75 | extern int crypto_core_salsa20_tweet(unsigned char *,const unsigned char *,const unsigned char *,const unsigned char *); 76 | #define crypto_core_salsa20_tweet_VERSION "-" 77 | #define crypto_core_salsa20 crypto_core_salsa20_tweet 78 | #define crypto_core_salsa20_OUTPUTBYTES crypto_core_salsa20_tweet_OUTPUTBYTES 79 | #define crypto_core_salsa20_INPUTBYTES crypto_core_salsa20_tweet_INPUTBYTES 80 | #define crypto_core_salsa20_KEYBYTES crypto_core_salsa20_tweet_KEYBYTES 81 | #define crypto_core_salsa20_CONSTBYTES crypto_core_salsa20_tweet_CONSTBYTES 82 | #define crypto_core_salsa20_VERSION crypto_core_salsa20_tweet_VERSION 83 | #define crypto_core_salsa20_IMPLEMENTATION "crypto_core/salsa20/tweet" 84 | #define crypto_core_hsalsa20_tweet_OUTPUTBYTES 32 85 | #define crypto_core_hsalsa20_tweet_INPUTBYTES 16 86 | #define crypto_core_hsalsa20_tweet_KEYBYTES 32 87 | #define crypto_core_hsalsa20_tweet_CONSTBYTES 16 88 | extern int crypto_core_hsalsa20_tweet(unsigned char *,const unsigned char *,const unsigned char *,const unsigned char *); 89 | #define crypto_core_hsalsa20_tweet_VERSION "-" 90 | #define crypto_core_hsalsa20 crypto_core_hsalsa20_tweet 91 | #define crypto_core_hsalsa20_OUTPUTBYTES crypto_core_hsalsa20_tweet_OUTPUTBYTES 92 | #define crypto_core_hsalsa20_INPUTBYTES crypto_core_hsalsa20_tweet_INPUTBYTES 93 | #define crypto_core_hsalsa20_KEYBYTES crypto_core_hsalsa20_tweet_KEYBYTES 94 | #define crypto_core_hsalsa20_CONSTBYTES crypto_core_hsalsa20_tweet_CONSTBYTES 95 | #define crypto_core_hsalsa20_VERSION crypto_core_hsalsa20_tweet_VERSION 96 | #define crypto_core_hsalsa20_IMPLEMENTATION "crypto_core/hsalsa20/tweet" 97 | #define crypto_hashblocks_PRIMITIVE "sha512" 98 | #define crypto_hashblocks crypto_hashblocks_sha512 99 | #define crypto_hashblocks_STATEBYTES crypto_hashblocks_sha512_STATEBYTES 100 | #define crypto_hashblocks_BLOCKBYTES crypto_hashblocks_sha512_BLOCKBYTES 101 | #define crypto_hashblocks_IMPLEMENTATION crypto_hashblocks_sha512_IMPLEMENTATION 102 | #define crypto_hashblocks_VERSION crypto_hashblocks_sha512_VERSION 103 | #define crypto_hashblocks_sha512_tweet_STATEBYTES 64 104 | #define crypto_hashblocks_sha512_tweet_BLOCKBYTES 128 105 | extern int crypto_hashblocks_sha512_tweet(unsigned char *,const unsigned char *,unsigned long long); 106 | #define crypto_hashblocks_sha512_tweet_VERSION "-" 107 | #define crypto_hashblocks_sha512 crypto_hashblocks_sha512_tweet 108 | #define crypto_hashblocks_sha512_STATEBYTES crypto_hashblocks_sha512_tweet_STATEBYTES 109 | #define crypto_hashblocks_sha512_BLOCKBYTES crypto_hashblocks_sha512_tweet_BLOCKBYTES 110 | #define crypto_hashblocks_sha512_VERSION crypto_hashblocks_sha512_tweet_VERSION 111 | #define crypto_hashblocks_sha512_IMPLEMENTATION "crypto_hashblocks/sha512/tweet" 112 | #define crypto_hashblocks_sha256_tweet_STATEBYTES 32 113 | #define crypto_hashblocks_sha256_tweet_BLOCKBYTES 64 114 | extern int crypto_hashblocks_sha256_tweet(unsigned char *,const unsigned char *,unsigned long long); 115 | #define crypto_hashblocks_sha256_tweet_VERSION "-" 116 | #define crypto_hashblocks_sha256 crypto_hashblocks_sha256_tweet 117 | #define crypto_hashblocks_sha256_STATEBYTES crypto_hashblocks_sha256_tweet_STATEBYTES 118 | #define crypto_hashblocks_sha256_BLOCKBYTES crypto_hashblocks_sha256_tweet_BLOCKBYTES 119 | #define crypto_hashblocks_sha256_VERSION crypto_hashblocks_sha256_tweet_VERSION 120 | #define crypto_hashblocks_sha256_IMPLEMENTATION "crypto_hashblocks/sha256/tweet" 121 | #define crypto_hash_PRIMITIVE "sha512" 122 | #define crypto_hash crypto_hash_sha512 123 | #define crypto_hash_BYTES crypto_hash_sha512_BYTES 124 | #define crypto_hash_IMPLEMENTATION crypto_hash_sha512_IMPLEMENTATION 125 | #define crypto_hash_VERSION crypto_hash_sha512_VERSION 126 | #define crypto_hash_sha512_tweet_BYTES 64 127 | extern int crypto_hash_sha512_tweet(unsigned char *,const unsigned char *,unsigned long long); 128 | #define crypto_hash_sha512_tweet_VERSION "-" 129 | #define crypto_hash_sha512 crypto_hash_sha512_tweet 130 | #define crypto_hash_sha512_BYTES crypto_hash_sha512_tweet_BYTES 131 | #define crypto_hash_sha512_VERSION crypto_hash_sha512_tweet_VERSION 132 | #define crypto_hash_sha512_IMPLEMENTATION "crypto_hash/sha512/tweet" 133 | #define crypto_hash_sha256_tweet_BYTES 32 134 | extern int crypto_hash_sha256_tweet(unsigned char *,const unsigned char *,unsigned long long); 135 | #define crypto_hash_sha256_tweet_VERSION "-" 136 | #define crypto_hash_sha256 crypto_hash_sha256_tweet 137 | #define crypto_hash_sha256_BYTES crypto_hash_sha256_tweet_BYTES 138 | #define crypto_hash_sha256_VERSION crypto_hash_sha256_tweet_VERSION 139 | #define crypto_hash_sha256_IMPLEMENTATION "crypto_hash/sha256/tweet" 140 | #define crypto_onetimeauth_PRIMITIVE "poly1305" 141 | #define crypto_onetimeauth crypto_onetimeauth_poly1305 142 | #define crypto_onetimeauth_verify crypto_onetimeauth_poly1305_verify 143 | #define crypto_onetimeauth_BYTES crypto_onetimeauth_poly1305_BYTES 144 | #define crypto_onetimeauth_KEYBYTES crypto_onetimeauth_poly1305_KEYBYTES 145 | #define crypto_onetimeauth_IMPLEMENTATION crypto_onetimeauth_poly1305_IMPLEMENTATION 146 | #define crypto_onetimeauth_VERSION crypto_onetimeauth_poly1305_VERSION 147 | #define crypto_onetimeauth_poly1305_tweet_BYTES 16 148 | #define crypto_onetimeauth_poly1305_tweet_KEYBYTES 32 149 | extern int crypto_onetimeauth_poly1305_tweet(unsigned char *,const unsigned char *,unsigned long long,const unsigned char *); 150 | extern int crypto_onetimeauth_poly1305_tweet_verify(const unsigned char *,const unsigned char *,unsigned long long,const unsigned char *); 151 | #define crypto_onetimeauth_poly1305_tweet_VERSION "-" 152 | #define crypto_onetimeauth_poly1305 crypto_onetimeauth_poly1305_tweet 153 | #define crypto_onetimeauth_poly1305_verify crypto_onetimeauth_poly1305_tweet_verify 154 | #define crypto_onetimeauth_poly1305_BYTES crypto_onetimeauth_poly1305_tweet_BYTES 155 | #define crypto_onetimeauth_poly1305_KEYBYTES crypto_onetimeauth_poly1305_tweet_KEYBYTES 156 | #define crypto_onetimeauth_poly1305_VERSION crypto_onetimeauth_poly1305_tweet_VERSION 157 | #define crypto_onetimeauth_poly1305_IMPLEMENTATION "crypto_onetimeauth/poly1305/tweet" 158 | #define crypto_scalarmult_PRIMITIVE "curve25519" 159 | #define crypto_scalarmult crypto_scalarmult_curve25519 160 | #define crypto_scalarmult_base crypto_scalarmult_curve25519_base 161 | #define crypto_scalarmult_BYTES crypto_scalarmult_curve25519_BYTES 162 | #define crypto_scalarmult_SCALARBYTES crypto_scalarmult_curve25519_SCALARBYTES 163 | #define crypto_scalarmult_IMPLEMENTATION crypto_scalarmult_curve25519_IMPLEMENTATION 164 | #define crypto_scalarmult_VERSION crypto_scalarmult_curve25519_VERSION 165 | #define crypto_scalarmult_curve25519_tweet_BYTES 32 166 | #define crypto_scalarmult_curve25519_tweet_SCALARBYTES 32 167 | extern int crypto_scalarmult_curve25519_tweet(unsigned char *,const unsigned char *,const unsigned char *); 168 | extern int crypto_scalarmult_curve25519_tweet_base(unsigned char *,const unsigned char *); 169 | #define crypto_scalarmult_curve25519_tweet_VERSION "-" 170 | #define crypto_scalarmult_curve25519 crypto_scalarmult_curve25519_tweet 171 | #define crypto_scalarmult_curve25519_base crypto_scalarmult_curve25519_tweet_base 172 | #define crypto_scalarmult_curve25519_BYTES crypto_scalarmult_curve25519_tweet_BYTES 173 | #define crypto_scalarmult_curve25519_SCALARBYTES crypto_scalarmult_curve25519_tweet_SCALARBYTES 174 | #define crypto_scalarmult_curve25519_VERSION crypto_scalarmult_curve25519_tweet_VERSION 175 | #define crypto_scalarmult_curve25519_IMPLEMENTATION "crypto_scalarmult/curve25519/tweet" 176 | #define crypto_secretbox_PRIMITIVE "xsalsa20poly1305" 177 | #define crypto_secretbox crypto_secretbox_xsalsa20poly1305 178 | #define crypto_secretbox_open crypto_secretbox_xsalsa20poly1305_open 179 | #define crypto_secretbox_KEYBYTES crypto_secretbox_xsalsa20poly1305_KEYBYTES 180 | #define crypto_secretbox_NONCEBYTES crypto_secretbox_xsalsa20poly1305_NONCEBYTES 181 | #define crypto_secretbox_ZEROBYTES crypto_secretbox_xsalsa20poly1305_ZEROBYTES 182 | #define crypto_secretbox_BOXZEROBYTES crypto_secretbox_xsalsa20poly1305_BOXZEROBYTES 183 | #define crypto_secretbox_IMPLEMENTATION crypto_secretbox_xsalsa20poly1305_IMPLEMENTATION 184 | #define crypto_secretbox_VERSION crypto_secretbox_xsalsa20poly1305_VERSION 185 | #define crypto_secretbox_xsalsa20poly1305_tweet_KEYBYTES 32 186 | #define crypto_secretbox_xsalsa20poly1305_tweet_NONCEBYTES 24 187 | #define crypto_secretbox_xsalsa20poly1305_tweet_ZEROBYTES 32 188 | #define crypto_secretbox_xsalsa20poly1305_tweet_BOXZEROBYTES 16 189 | extern int crypto_secretbox_xsalsa20poly1305_tweet(unsigned char *,const unsigned char *,unsigned long long,const unsigned char *,const unsigned char *); 190 | extern int crypto_secretbox_xsalsa20poly1305_tweet_open(unsigned char *,const unsigned char *,unsigned long long,const unsigned char *,const unsigned char *); 191 | #define crypto_secretbox_xsalsa20poly1305_tweet_VERSION "-" 192 | #define crypto_secretbox_xsalsa20poly1305 crypto_secretbox_xsalsa20poly1305_tweet 193 | #define crypto_secretbox_xsalsa20poly1305_open crypto_secretbox_xsalsa20poly1305_tweet_open 194 | #define crypto_secretbox_xsalsa20poly1305_KEYBYTES crypto_secretbox_xsalsa20poly1305_tweet_KEYBYTES 195 | #define crypto_secretbox_xsalsa20poly1305_NONCEBYTES crypto_secretbox_xsalsa20poly1305_tweet_NONCEBYTES 196 | #define crypto_secretbox_xsalsa20poly1305_ZEROBYTES crypto_secretbox_xsalsa20poly1305_tweet_ZEROBYTES 197 | #define crypto_secretbox_xsalsa20poly1305_BOXZEROBYTES crypto_secretbox_xsalsa20poly1305_tweet_BOXZEROBYTES 198 | #define crypto_secretbox_xsalsa20poly1305_VERSION crypto_secretbox_xsalsa20poly1305_tweet_VERSION 199 | #define crypto_secretbox_xsalsa20poly1305_IMPLEMENTATION "crypto_secretbox/xsalsa20poly1305/tweet" 200 | #define crypto_sign_PRIMITIVE "ed25519" 201 | #define crypto_sign crypto_sign_ed25519 202 | #define crypto_sign_open crypto_sign_ed25519_open 203 | #define crypto_sign_keypair crypto_sign_ed25519_keypair 204 | #define crypto_sign_BYTES crypto_sign_ed25519_BYTES 205 | #define crypto_sign_PUBLICKEYBYTES crypto_sign_ed25519_PUBLICKEYBYTES 206 | #define crypto_sign_SECRETKEYBYTES crypto_sign_ed25519_SECRETKEYBYTES 207 | #define crypto_sign_IMPLEMENTATION crypto_sign_ed25519_IMPLEMENTATION 208 | #define crypto_sign_VERSION crypto_sign_ed25519_VERSION 209 | #define crypto_sign_ed25519_tweet_BYTES 64 210 | #define crypto_sign_ed25519_tweet_PUBLICKEYBYTES 32 211 | #define crypto_sign_ed25519_tweet_SECRETKEYBYTES 64 212 | extern int crypto_sign_ed25519_tweet(unsigned char *,unsigned long long *,const unsigned char *,unsigned long long,const unsigned char *); 213 | extern int crypto_sign_ed25519_tweet_open(unsigned char *,unsigned long long *,const unsigned char *,unsigned long long,const unsigned char *); 214 | extern int crypto_sign_ed25519_tweet_keypair(unsigned char *,unsigned char *); 215 | #define crypto_sign_ed25519_tweet_VERSION "-" 216 | #define crypto_sign_ed25519 crypto_sign_ed25519_tweet 217 | #define crypto_sign_ed25519_open crypto_sign_ed25519_tweet_open 218 | #define crypto_sign_ed25519_keypair crypto_sign_ed25519_tweet_keypair 219 | #define crypto_sign_ed25519_BYTES crypto_sign_ed25519_tweet_BYTES 220 | #define crypto_sign_ed25519_PUBLICKEYBYTES crypto_sign_ed25519_tweet_PUBLICKEYBYTES 221 | #define crypto_sign_ed25519_SECRETKEYBYTES crypto_sign_ed25519_tweet_SECRETKEYBYTES 222 | #define crypto_sign_ed25519_VERSION crypto_sign_ed25519_tweet_VERSION 223 | #define crypto_sign_ed25519_IMPLEMENTATION "crypto_sign/ed25519/tweet" 224 | #define crypto_stream_PRIMITIVE "xsalsa20" 225 | #define crypto_stream crypto_stream_xsalsa20 226 | #define crypto_stream_xor crypto_stream_xsalsa20_xor 227 | #define crypto_stream_KEYBYTES crypto_stream_xsalsa20_KEYBYTES 228 | #define crypto_stream_NONCEBYTES crypto_stream_xsalsa20_NONCEBYTES 229 | #define crypto_stream_IMPLEMENTATION crypto_stream_xsalsa20_IMPLEMENTATION 230 | #define crypto_stream_VERSION crypto_stream_xsalsa20_VERSION 231 | #define crypto_stream_xsalsa20_tweet_KEYBYTES 32 232 | #define crypto_stream_xsalsa20_tweet_NONCEBYTES 24 233 | extern int crypto_stream_xsalsa20_tweet(unsigned char *,unsigned long long,const unsigned char *,const unsigned char *); 234 | extern int crypto_stream_xsalsa20_tweet_xor(unsigned char *,const unsigned char *,unsigned long long,const unsigned char *,const unsigned char *); 235 | #define crypto_stream_xsalsa20_tweet_VERSION "-" 236 | #define crypto_stream_xsalsa20 crypto_stream_xsalsa20_tweet 237 | #define crypto_stream_xsalsa20_xor crypto_stream_xsalsa20_tweet_xor 238 | #define crypto_stream_xsalsa20_KEYBYTES crypto_stream_xsalsa20_tweet_KEYBYTES 239 | #define crypto_stream_xsalsa20_NONCEBYTES crypto_stream_xsalsa20_tweet_NONCEBYTES 240 | #define crypto_stream_xsalsa20_VERSION crypto_stream_xsalsa20_tweet_VERSION 241 | #define crypto_stream_xsalsa20_IMPLEMENTATION "crypto_stream/xsalsa20/tweet" 242 | #define crypto_stream_salsa20_tweet_KEYBYTES 32 243 | #define crypto_stream_salsa20_tweet_NONCEBYTES 8 244 | extern int crypto_stream_salsa20_tweet(unsigned char *,unsigned long long,const unsigned char *,const unsigned char *); 245 | extern int crypto_stream_salsa20_tweet_xor(unsigned char *,const unsigned char *,unsigned long long,const unsigned char *,const unsigned char *); 246 | #define crypto_stream_salsa20_tweet_VERSION "-" 247 | #define crypto_stream_salsa20 crypto_stream_salsa20_tweet 248 | #define crypto_stream_salsa20_xor crypto_stream_salsa20_tweet_xor 249 | #define crypto_stream_salsa20_KEYBYTES crypto_stream_salsa20_tweet_KEYBYTES 250 | #define crypto_stream_salsa20_NONCEBYTES crypto_stream_salsa20_tweet_NONCEBYTES 251 | #define crypto_stream_salsa20_VERSION crypto_stream_salsa20_tweet_VERSION 252 | #define crypto_stream_salsa20_IMPLEMENTATION "crypto_stream/salsa20/tweet" 253 | #define crypto_verify_PRIMITIVE "16" 254 | #define crypto_verify crypto_verify_16 255 | #define crypto_verify_BYTES crypto_verify_16_BYTES 256 | #define crypto_verify_IMPLEMENTATION crypto_verify_16_IMPLEMENTATION 257 | #define crypto_verify_VERSION crypto_verify_16_VERSION 258 | #define crypto_verify_16_tweet_BYTES 16 259 | extern int crypto_verify_16_tweet(const unsigned char *,const unsigned char *); 260 | #define crypto_verify_16_tweet_VERSION "-" 261 | #define crypto_verify_16 crypto_verify_16_tweet 262 | #define crypto_verify_16_BYTES crypto_verify_16_tweet_BYTES 263 | #define crypto_verify_16_VERSION crypto_verify_16_tweet_VERSION 264 | #define crypto_verify_16_IMPLEMENTATION "crypto_verify/16/tweet" 265 | #define crypto_verify_32_tweet_BYTES 32 266 | extern int crypto_verify_32_tweet(const unsigned char *,const unsigned char *); 267 | #define crypto_verify_32_tweet_VERSION "-" 268 | #define crypto_verify_32 crypto_verify_32_tweet 269 | #define crypto_verify_32_BYTES crypto_verify_32_tweet_BYTES 270 | #define crypto_verify_32_VERSION crypto_verify_32_tweet_VERSION 271 | #define crypto_verify_32_IMPLEMENTATION "crypto_verify/32/tweet" 272 | #endif 273 | -------------------------------------------------------------------------------- /TweetNacl.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 47; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 52D6D9871BEFF229002C0205 /* TweetNacl.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 52D6D97C1BEFF229002C0205 /* TweetNacl.framework */; }; 11 | 5816A3211F99F27300F580B2 /* Constant.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5816A3201F99F27300F580B2 /* Constant.swift */; }; 12 | 5816A3221F99F27300F580B2 /* Constant.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5816A3201F99F27300F580B2 /* Constant.swift */; }; 13 | 5816A3231F99F27300F580B2 /* Constant.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5816A3201F99F27300F580B2 /* Constant.swift */; }; 14 | 5816A3241F99F27300F580B2 /* Constant.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5816A3201F99F27300F580B2 /* Constant.swift */; }; 15 | 58B0C0B51F99D78C00B49C81 /* BoxTestData.json in Resources */ = {isa = PBXBuildFile; fileRef = 58B0C0AD1F99D78B00B49C81 /* BoxTestData.json */; }; 16 | 58B0C0B61F99D78C00B49C81 /* BoxTestData.json in Resources */ = {isa = PBXBuildFile; fileRef = 58B0C0AD1F99D78B00B49C81 /* BoxTestData.json */; }; 17 | 58B0C0B71F99D78C00B49C81 /* BoxTestData.json in Resources */ = {isa = PBXBuildFile; fileRef = 58B0C0AD1F99D78B00B49C81 /* BoxTestData.json */; }; 18 | 58B0C0B81F99D78C00B49C81 /* NaclBox_Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 58B0C0AE1F99D78B00B49C81 /* NaclBox_Tests.swift */; }; 19 | 58B0C0B91F99D78C00B49C81 /* NaclBox_Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 58B0C0AE1F99D78B00B49C81 /* NaclBox_Tests.swift */; }; 20 | 58B0C0BA1F99D78C00B49C81 /* NaclBox_Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 58B0C0AE1F99D78B00B49C81 /* NaclBox_Tests.swift */; }; 21 | 58B0C0BB1F99D78C00B49C81 /* NaclSecretbox_Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 58B0C0AF1F99D78B00B49C81 /* NaclSecretbox_Tests.swift */; }; 22 | 58B0C0BC1F99D78C00B49C81 /* NaclSecretbox_Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 58B0C0AF1F99D78B00B49C81 /* NaclSecretbox_Tests.swift */; }; 23 | 58B0C0BD1F99D78C00B49C81 /* NaclSecretbox_Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 58B0C0AF1F99D78B00B49C81 /* NaclSecretbox_Tests.swift */; }; 24 | 58B0C0BE1F99D78C00B49C81 /* SignTestData.json in Resources */ = {isa = PBXBuildFile; fileRef = 58B0C0B01F99D78B00B49C81 /* SignTestData.json */; }; 25 | 58B0C0BF1F99D78C00B49C81 /* SignTestData.json in Resources */ = {isa = PBXBuildFile; fileRef = 58B0C0B01F99D78B00B49C81 /* SignTestData.json */; }; 26 | 58B0C0C01F99D78C00B49C81 /* SignTestData.json in Resources */ = {isa = PBXBuildFile; fileRef = 58B0C0B01F99D78B00B49C81 /* SignTestData.json */; }; 27 | 58B0C0C11F99D78C00B49C81 /* NaclScalarMulti_Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 58B0C0B11F99D78B00B49C81 /* NaclScalarMulti_Tests.swift */; }; 28 | 58B0C0C21F99D78C00B49C81 /* NaclScalarMulti_Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 58B0C0B11F99D78B00B49C81 /* NaclScalarMulti_Tests.swift */; }; 29 | 58B0C0C31F99D78C00B49C81 /* NaclScalarMulti_Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 58B0C0B11F99D78B00B49C81 /* NaclScalarMulti_Tests.swift */; }; 30 | 58B0C0C41F99D78C00B49C81 /* ScalarMultiTestData.json in Resources */ = {isa = PBXBuildFile; fileRef = 58B0C0B21F99D78B00B49C81 /* ScalarMultiTestData.json */; }; 31 | 58B0C0C51F99D78C00B49C81 /* ScalarMultiTestData.json in Resources */ = {isa = PBXBuildFile; fileRef = 58B0C0B21F99D78B00B49C81 /* ScalarMultiTestData.json */; }; 32 | 58B0C0C61F99D78C00B49C81 /* ScalarMultiTestData.json in Resources */ = {isa = PBXBuildFile; fileRef = 58B0C0B21F99D78B00B49C81 /* ScalarMultiTestData.json */; }; 33 | 58B0C0C71F99D78C00B49C81 /* SecretboxTestData.json in Resources */ = {isa = PBXBuildFile; fileRef = 58B0C0B31F99D78B00B49C81 /* SecretboxTestData.json */; }; 34 | 58B0C0C81F99D78C00B49C81 /* SecretboxTestData.json in Resources */ = {isa = PBXBuildFile; fileRef = 58B0C0B31F99D78B00B49C81 /* SecretboxTestData.json */; }; 35 | 58B0C0C91F99D78C00B49C81 /* SecretboxTestData.json in Resources */ = {isa = PBXBuildFile; fileRef = 58B0C0B31F99D78B00B49C81 /* SecretboxTestData.json */; }; 36 | 58B0C0CA1F99D78C00B49C81 /* NaclSign_Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 58B0C0B41F99D78C00B49C81 /* NaclSign_Tests.swift */; }; 37 | 58B0C0CB1F99D78C00B49C81 /* NaclSign_Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 58B0C0B41F99D78C00B49C81 /* NaclSign_Tests.swift */; }; 38 | 58B0C0CC1F99D78C00B49C81 /* NaclSign_Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 58B0C0B41F99D78C00B49C81 /* NaclSign_Tests.swift */; }; 39 | 58B0C0D41F99EBCA00B49C81 /* TweetNacl.h in Headers */ = {isa = PBXBuildFile; fileRef = 58B0C0D21F99EBCA00B49C81 /* TweetNacl.h */; settings = {ATTRIBUTES = (Public, ); }; }; 40 | 58B0C0D51F99EBCA00B49C81 /* TweetNacl.h in Headers */ = {isa = PBXBuildFile; fileRef = 58B0C0D21F99EBCA00B49C81 /* TweetNacl.h */; settings = {ATTRIBUTES = (Public, ); }; }; 41 | 58B0C0D61F99EBCA00B49C81 /* TweetNacl.h in Headers */ = {isa = PBXBuildFile; fileRef = 58B0C0D21F99EBCA00B49C81 /* TweetNacl.h */; settings = {ATTRIBUTES = (Public, ); }; }; 42 | 58B0C0D71F99EBCA00B49C81 /* TweetNacl.h in Headers */ = {isa = PBXBuildFile; fileRef = 58B0C0D21F99EBCA00B49C81 /* TweetNacl.h */; settings = {ATTRIBUTES = (Public, ); }; }; 43 | 58B0C0D81F99EBCA00B49C81 /* TweetNacl.swift in Sources */ = {isa = PBXBuildFile; fileRef = 58B0C0D31F99EBCA00B49C81 /* TweetNacl.swift */; }; 44 | 58B0C0D91F99EBCA00B49C81 /* TweetNacl.swift in Sources */ = {isa = PBXBuildFile; fileRef = 58B0C0D31F99EBCA00B49C81 /* TweetNacl.swift */; }; 45 | 58B0C0DA1F99EBCA00B49C81 /* TweetNacl.swift in Sources */ = {isa = PBXBuildFile; fileRef = 58B0C0D31F99EBCA00B49C81 /* TweetNacl.swift */; }; 46 | 58B0C0DB1F99EBCA00B49C81 /* TweetNacl.swift in Sources */ = {isa = PBXBuildFile; fileRef = 58B0C0D31F99EBCA00B49C81 /* TweetNacl.swift */; }; 47 | 58B0C0E11F99EF0D00B49C81 /* ctweetnacl.h in Headers */ = {isa = PBXBuildFile; fileRef = 58B0C0DF1F99EF0D00B49C81 /* ctweetnacl.h */; }; 48 | 58B0C0E21F99EF0D00B49C81 /* ctweetnacl.h in Headers */ = {isa = PBXBuildFile; fileRef = 58B0C0DF1F99EF0D00B49C81 /* ctweetnacl.h */; }; 49 | 58B0C0E31F99EF0D00B49C81 /* ctweetnacl.h in Headers */ = {isa = PBXBuildFile; fileRef = 58B0C0DF1F99EF0D00B49C81 /* ctweetnacl.h */; }; 50 | 58B0C0E41F99EF0D00B49C81 /* ctweetnacl.h in Headers */ = {isa = PBXBuildFile; fileRef = 58B0C0DF1F99EF0D00B49C81 /* ctweetnacl.h */; }; 51 | 58B0C0E51F99EF0D00B49C81 /* ctweetnacl.c in Sources */ = {isa = PBXBuildFile; fileRef = 58B0C0E01F99EF0D00B49C81 /* ctweetnacl.c */; }; 52 | 58B0C0E61F99EF0D00B49C81 /* ctweetnacl.c in Sources */ = {isa = PBXBuildFile; fileRef = 58B0C0E01F99EF0D00B49C81 /* ctweetnacl.c */; }; 53 | 58B0C0E71F99EF0D00B49C81 /* ctweetnacl.c in Sources */ = {isa = PBXBuildFile; fileRef = 58B0C0E01F99EF0D00B49C81 /* ctweetnacl.c */; }; 54 | 58B0C0E81F99EF0D00B49C81 /* ctweetnacl.c in Sources */ = {isa = PBXBuildFile; fileRef = 58B0C0E01F99EF0D00B49C81 /* ctweetnacl.c */; }; 55 | DD7502881C68FEDE006590AF /* TweetNacl.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 52D6DA0F1BF000BD002C0205 /* TweetNacl.framework */; }; 56 | DD7502921C690C7A006590AF /* TweetNacl.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 52D6D9F01BEFFFBE002C0205 /* TweetNacl.framework */; }; 57 | /* End PBXBuildFile section */ 58 | 59 | /* Begin PBXContainerItemProxy section */ 60 | 52D6D9881BEFF229002C0205 /* PBXContainerItemProxy */ = { 61 | isa = PBXContainerItemProxy; 62 | containerPortal = 52D6D9731BEFF229002C0205 /* Project object */; 63 | proxyType = 1; 64 | remoteGlobalIDString = 52D6D97B1BEFF229002C0205; 65 | remoteInfo = TweetNacl; 66 | }; 67 | DD7502801C68FCFC006590AF /* PBXContainerItemProxy */ = { 68 | isa = PBXContainerItemProxy; 69 | containerPortal = 52D6D9731BEFF229002C0205 /* Project object */; 70 | proxyType = 1; 71 | remoteGlobalIDString = 52D6DA0E1BF000BD002C0205; 72 | remoteInfo = "TweetNacl-macOS"; 73 | }; 74 | DD7502931C690C7A006590AF /* PBXContainerItemProxy */ = { 75 | isa = PBXContainerItemProxy; 76 | containerPortal = 52D6D9731BEFF229002C0205 /* Project object */; 77 | proxyType = 1; 78 | remoteGlobalIDString = 52D6D9EF1BEFFFBE002C0205; 79 | remoteInfo = "TweetNacl-tvOS"; 80 | }; 81 | /* End PBXContainerItemProxy section */ 82 | 83 | /* Begin PBXFileReference section */ 84 | 52D6D97C1BEFF229002C0205 /* TweetNacl.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = TweetNacl.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 85 | 52D6D9861BEFF229002C0205 /* TweetNacl-iOS Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "TweetNacl-iOS Tests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; 86 | 52D6D9E21BEFFF6E002C0205 /* TweetNacl.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = TweetNacl.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 87 | 52D6D9F01BEFFFBE002C0205 /* TweetNacl.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = TweetNacl.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 88 | 52D6DA0F1BF000BD002C0205 /* TweetNacl.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = TweetNacl.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 89 | 5816A3201F99F27300F580B2 /* Constant.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Constant.swift; sourceTree = ""; }; 90 | 58B0C0AD1F99D78B00B49C81 /* BoxTestData.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = BoxTestData.json; sourceTree = ""; }; 91 | 58B0C0AE1F99D78B00B49C81 /* NaclBox_Tests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NaclBox_Tests.swift; sourceTree = ""; }; 92 | 58B0C0AF1F99D78B00B49C81 /* NaclSecretbox_Tests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NaclSecretbox_Tests.swift; sourceTree = ""; }; 93 | 58B0C0B01F99D78B00B49C81 /* SignTestData.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = SignTestData.json; sourceTree = ""; }; 94 | 58B0C0B11F99D78B00B49C81 /* NaclScalarMulti_Tests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NaclScalarMulti_Tests.swift; sourceTree = ""; }; 95 | 58B0C0B21F99D78B00B49C81 /* ScalarMultiTestData.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = ScalarMultiTestData.json; sourceTree = ""; }; 96 | 58B0C0B31F99D78B00B49C81 /* SecretboxTestData.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = SecretboxTestData.json; sourceTree = ""; }; 97 | 58B0C0B41F99D78C00B49C81 /* NaclSign_Tests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NaclSign_Tests.swift; sourceTree = ""; }; 98 | 58B0C0D21F99EBCA00B49C81 /* TweetNacl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TweetNacl.h; sourceTree = ""; }; 99 | 58B0C0D31F99EBCA00B49C81 /* TweetNacl.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TweetNacl.swift; sourceTree = ""; }; 100 | 58B0C0DC1F99EF0D00B49C81 /* module.map */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = "sourcecode.module-map"; path = module.map; sourceTree = ""; }; 101 | 58B0C0DF1F99EF0D00B49C81 /* ctweetnacl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ctweetnacl.h; sourceTree = ""; }; 102 | 58B0C0E01F99EF0D00B49C81 /* ctweetnacl.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ctweetnacl.c; sourceTree = ""; }; 103 | AD2FAA261CD0B6D800659CF4 /* TweetNacl.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = TweetNacl.plist; sourceTree = ""; }; 104 | AD2FAA281CD0B6E100659CF4 /* TweetNaclTests.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = TweetNaclTests.plist; sourceTree = ""; }; 105 | DD75027A1C68FCFC006590AF /* TweetNacl-macOS Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "TweetNacl-macOS Tests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; 106 | DD75028D1C690C7A006590AF /* TweetNacl-tvOS Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "TweetNacl-tvOS Tests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; 107 | /* End PBXFileReference section */ 108 | 109 | /* Begin PBXFrameworksBuildPhase section */ 110 | 52D6D9781BEFF229002C0205 /* Frameworks */ = { 111 | isa = PBXFrameworksBuildPhase; 112 | buildActionMask = 2147483647; 113 | files = ( 114 | ); 115 | runOnlyForDeploymentPostprocessing = 0; 116 | }; 117 | 52D6D9831BEFF229002C0205 /* Frameworks */ = { 118 | isa = PBXFrameworksBuildPhase; 119 | buildActionMask = 2147483647; 120 | files = ( 121 | 52D6D9871BEFF229002C0205 /* TweetNacl.framework in Frameworks */, 122 | ); 123 | runOnlyForDeploymentPostprocessing = 0; 124 | }; 125 | 52D6D9DE1BEFFF6E002C0205 /* Frameworks */ = { 126 | isa = PBXFrameworksBuildPhase; 127 | buildActionMask = 2147483647; 128 | files = ( 129 | ); 130 | runOnlyForDeploymentPostprocessing = 0; 131 | }; 132 | 52D6D9EC1BEFFFBE002C0205 /* Frameworks */ = { 133 | isa = PBXFrameworksBuildPhase; 134 | buildActionMask = 2147483647; 135 | files = ( 136 | ); 137 | runOnlyForDeploymentPostprocessing = 0; 138 | }; 139 | 52D6DA0B1BF000BD002C0205 /* Frameworks */ = { 140 | isa = PBXFrameworksBuildPhase; 141 | buildActionMask = 2147483647; 142 | files = ( 143 | ); 144 | runOnlyForDeploymentPostprocessing = 0; 145 | }; 146 | DD7502771C68FCFC006590AF /* Frameworks */ = { 147 | isa = PBXFrameworksBuildPhase; 148 | buildActionMask = 2147483647; 149 | files = ( 150 | DD7502881C68FEDE006590AF /* TweetNacl.framework in Frameworks */, 151 | ); 152 | runOnlyForDeploymentPostprocessing = 0; 153 | }; 154 | DD75028A1C690C7A006590AF /* Frameworks */ = { 155 | isa = PBXFrameworksBuildPhase; 156 | buildActionMask = 2147483647; 157 | files = ( 158 | DD7502921C690C7A006590AF /* TweetNacl.framework in Frameworks */, 159 | ); 160 | runOnlyForDeploymentPostprocessing = 0; 161 | }; 162 | /* End PBXFrameworksBuildPhase section */ 163 | 164 | /* Begin PBXGroup section */ 165 | 52D6D9721BEFF229002C0205 = { 166 | isa = PBXGroup; 167 | children = ( 168 | 8933C7811EB5B7E0000D00A4 /* Sources */, 169 | 8933C7831EB5B7EB000D00A4 /* Tests */, 170 | 52D6D99C1BEFF38C002C0205 /* Configs */, 171 | 52D6D97D1BEFF229002C0205 /* Products */, 172 | ); 173 | sourceTree = ""; 174 | }; 175 | 52D6D97D1BEFF229002C0205 /* Products */ = { 176 | isa = PBXGroup; 177 | children = ( 178 | 52D6D97C1BEFF229002C0205 /* TweetNacl.framework */, 179 | 52D6D9861BEFF229002C0205 /* TweetNacl-iOS Tests.xctest */, 180 | 52D6D9E21BEFFF6E002C0205 /* TweetNacl.framework */, 181 | 52D6D9F01BEFFFBE002C0205 /* TweetNacl.framework */, 182 | 52D6DA0F1BF000BD002C0205 /* TweetNacl.framework */, 183 | DD75027A1C68FCFC006590AF /* TweetNacl-macOS Tests.xctest */, 184 | DD75028D1C690C7A006590AF /* TweetNacl-tvOS Tests.xctest */, 185 | ); 186 | name = Products; 187 | sourceTree = ""; 188 | }; 189 | 52D6D99C1BEFF38C002C0205 /* Configs */ = { 190 | isa = PBXGroup; 191 | children = ( 192 | DD7502721C68FC1B006590AF /* Frameworks */, 193 | DD7502731C68FC20006590AF /* Tests */, 194 | ); 195 | path = Configs; 196 | sourceTree = ""; 197 | }; 198 | 58B0C0D11F99EBCA00B49C81 /* TweetNacl */ = { 199 | isa = PBXGroup; 200 | children = ( 201 | 5816A3201F99F27300F580B2 /* Constant.swift */, 202 | 58B0C0D21F99EBCA00B49C81 /* TweetNacl.h */, 203 | 58B0C0D31F99EBCA00B49C81 /* TweetNacl.swift */, 204 | ); 205 | path = TweetNacl; 206 | sourceTree = ""; 207 | }; 208 | 58B0C0DD1F99EF0D00B49C81 /* CTweetNacl */ = { 209 | isa = PBXGroup; 210 | children = ( 211 | 58B0C0DE1F99EF0D00B49C81 /* include */, 212 | 58B0C0E01F99EF0D00B49C81 /* ctweetnacl.c */, 213 | ); 214 | path = CTweetNacl; 215 | sourceTree = ""; 216 | }; 217 | 58B0C0DE1F99EF0D00B49C81 /* include */ = { 218 | isa = PBXGroup; 219 | children = ( 220 | 58B0C0DF1F99EF0D00B49C81 /* ctweetnacl.h */, 221 | ); 222 | path = include; 223 | sourceTree = ""; 224 | }; 225 | 8933C7811EB5B7E0000D00A4 /* Sources */ = { 226 | isa = PBXGroup; 227 | children = ( 228 | 58B0C0DD1F99EF0D00B49C81 /* CTweetNacl */, 229 | 58B0C0DC1F99EF0D00B49C81 /* module.map */, 230 | 58B0C0D11F99EBCA00B49C81 /* TweetNacl */, 231 | ); 232 | path = Sources; 233 | sourceTree = ""; 234 | }; 235 | 8933C7831EB5B7EB000D00A4 /* Tests */ = { 236 | isa = PBXGroup; 237 | children = ( 238 | 58B0C0AE1F99D78B00B49C81 /* NaclBox_Tests.swift */, 239 | 58B0C0B11F99D78B00B49C81 /* NaclScalarMulti_Tests.swift */, 240 | 58B0C0AF1F99D78B00B49C81 /* NaclSecretbox_Tests.swift */, 241 | 58B0C0B41F99D78C00B49C81 /* NaclSign_Tests.swift */, 242 | 58B0C0AD1F99D78B00B49C81 /* BoxTestData.json */, 243 | 58B0C0B21F99D78B00B49C81 /* ScalarMultiTestData.json */, 244 | 58B0C0B31F99D78B00B49C81 /* SecretboxTestData.json */, 245 | 58B0C0B01F99D78B00B49C81 /* SignTestData.json */, 246 | ); 247 | name = Tests; 248 | path = Tests/TweetNaclTests; 249 | sourceTree = ""; 250 | }; 251 | DD7502721C68FC1B006590AF /* Frameworks */ = { 252 | isa = PBXGroup; 253 | children = ( 254 | AD2FAA261CD0B6D800659CF4 /* TweetNacl.plist */, 255 | ); 256 | name = Frameworks; 257 | sourceTree = ""; 258 | }; 259 | DD7502731C68FC20006590AF /* Tests */ = { 260 | isa = PBXGroup; 261 | children = ( 262 | AD2FAA281CD0B6E100659CF4 /* TweetNaclTests.plist */, 263 | ); 264 | name = Tests; 265 | sourceTree = ""; 266 | }; 267 | /* End PBXGroup section */ 268 | 269 | /* Begin PBXHeadersBuildPhase section */ 270 | 52D6D9791BEFF229002C0205 /* Headers */ = { 271 | isa = PBXHeadersBuildPhase; 272 | buildActionMask = 2147483647; 273 | files = ( 274 | 58B0C0E11F99EF0D00B49C81 /* ctweetnacl.h in Headers */, 275 | 58B0C0D41F99EBCA00B49C81 /* TweetNacl.h in Headers */, 276 | ); 277 | runOnlyForDeploymentPostprocessing = 0; 278 | }; 279 | 52D6D9DF1BEFFF6E002C0205 /* Headers */ = { 280 | isa = PBXHeadersBuildPhase; 281 | buildActionMask = 2147483647; 282 | files = ( 283 | 58B0C0E31F99EF0D00B49C81 /* ctweetnacl.h in Headers */, 284 | 58B0C0D61F99EBCA00B49C81 /* TweetNacl.h in Headers */, 285 | ); 286 | runOnlyForDeploymentPostprocessing = 0; 287 | }; 288 | 52D6D9ED1BEFFFBE002C0205 /* Headers */ = { 289 | isa = PBXHeadersBuildPhase; 290 | buildActionMask = 2147483647; 291 | files = ( 292 | 58B0C0E41F99EF0D00B49C81 /* ctweetnacl.h in Headers */, 293 | 58B0C0D71F99EBCA00B49C81 /* TweetNacl.h in Headers */, 294 | ); 295 | runOnlyForDeploymentPostprocessing = 0; 296 | }; 297 | 52D6DA0C1BF000BD002C0205 /* Headers */ = { 298 | isa = PBXHeadersBuildPhase; 299 | buildActionMask = 2147483647; 300 | files = ( 301 | 58B0C0E21F99EF0D00B49C81 /* ctweetnacl.h in Headers */, 302 | 58B0C0D51F99EBCA00B49C81 /* TweetNacl.h in Headers */, 303 | ); 304 | runOnlyForDeploymentPostprocessing = 0; 305 | }; 306 | /* End PBXHeadersBuildPhase section */ 307 | 308 | /* Begin PBXNativeTarget section */ 309 | 52D6D97B1BEFF229002C0205 /* TweetNacl-iOS */ = { 310 | isa = PBXNativeTarget; 311 | buildConfigurationList = 52D6D9901BEFF229002C0205 /* Build configuration list for PBXNativeTarget "TweetNacl-iOS" */; 312 | buildPhases = ( 313 | 52D6D9771BEFF229002C0205 /* Sources */, 314 | 52D6D9781BEFF229002C0205 /* Frameworks */, 315 | 52D6D9791BEFF229002C0205 /* Headers */, 316 | 52D6D97A1BEFF229002C0205 /* Resources */, 317 | ); 318 | buildRules = ( 319 | ); 320 | dependencies = ( 321 | ); 322 | name = "TweetNacl-iOS"; 323 | productName = TweetNacl; 324 | productReference = 52D6D97C1BEFF229002C0205 /* TweetNacl.framework */; 325 | productType = "com.apple.product-type.framework"; 326 | }; 327 | 52D6D9851BEFF229002C0205 /* TweetNacl-iOS Tests */ = { 328 | isa = PBXNativeTarget; 329 | buildConfigurationList = 52D6D9931BEFF229002C0205 /* Build configuration list for PBXNativeTarget "TweetNacl-iOS Tests" */; 330 | buildPhases = ( 331 | 52D6D9821BEFF229002C0205 /* Sources */, 332 | 52D6D9831BEFF229002C0205 /* Frameworks */, 333 | 52D6D9841BEFF229002C0205 /* Resources */, 334 | ); 335 | buildRules = ( 336 | ); 337 | dependencies = ( 338 | 52D6D9891BEFF229002C0205 /* PBXTargetDependency */, 339 | ); 340 | name = "TweetNacl-iOS Tests"; 341 | productName = TweetNaclTests; 342 | productReference = 52D6D9861BEFF229002C0205 /* TweetNacl-iOS Tests.xctest */; 343 | productType = "com.apple.product-type.bundle.unit-test"; 344 | }; 345 | 52D6D9E11BEFFF6E002C0205 /* TweetNacl-watchOS */ = { 346 | isa = PBXNativeTarget; 347 | buildConfigurationList = 52D6D9E71BEFFF6E002C0205 /* Build configuration list for PBXNativeTarget "TweetNacl-watchOS" */; 348 | buildPhases = ( 349 | 52D6D9DD1BEFFF6E002C0205 /* Sources */, 350 | 52D6D9DE1BEFFF6E002C0205 /* Frameworks */, 351 | 52D6D9DF1BEFFF6E002C0205 /* Headers */, 352 | 52D6D9E01BEFFF6E002C0205 /* Resources */, 353 | ); 354 | buildRules = ( 355 | ); 356 | dependencies = ( 357 | ); 358 | name = "TweetNacl-watchOS"; 359 | productName = "TweetNacl-watchOS"; 360 | productReference = 52D6D9E21BEFFF6E002C0205 /* TweetNacl.framework */; 361 | productType = "com.apple.product-type.framework"; 362 | }; 363 | 52D6D9EF1BEFFFBE002C0205 /* TweetNacl-tvOS */ = { 364 | isa = PBXNativeTarget; 365 | buildConfigurationList = 52D6DA011BEFFFBE002C0205 /* Build configuration list for PBXNativeTarget "TweetNacl-tvOS" */; 366 | buildPhases = ( 367 | 52D6D9EB1BEFFFBE002C0205 /* Sources */, 368 | 52D6D9EC1BEFFFBE002C0205 /* Frameworks */, 369 | 52D6D9ED1BEFFFBE002C0205 /* Headers */, 370 | 52D6D9EE1BEFFFBE002C0205 /* Resources */, 371 | ); 372 | buildRules = ( 373 | ); 374 | dependencies = ( 375 | ); 376 | name = "TweetNacl-tvOS"; 377 | productName = "TweetNacl-tvOS"; 378 | productReference = 52D6D9F01BEFFFBE002C0205 /* TweetNacl.framework */; 379 | productType = "com.apple.product-type.framework"; 380 | }; 381 | 52D6DA0E1BF000BD002C0205 /* TweetNacl-macOS */ = { 382 | isa = PBXNativeTarget; 383 | buildConfigurationList = 52D6DA201BF000BD002C0205 /* Build configuration list for PBXNativeTarget "TweetNacl-macOS" */; 384 | buildPhases = ( 385 | 52D6DA0A1BF000BD002C0205 /* Sources */, 386 | 52D6DA0B1BF000BD002C0205 /* Frameworks */, 387 | 52D6DA0C1BF000BD002C0205 /* Headers */, 388 | 52D6DA0D1BF000BD002C0205 /* Resources */, 389 | ); 390 | buildRules = ( 391 | ); 392 | dependencies = ( 393 | ); 394 | name = "TweetNacl-macOS"; 395 | productName = "TweetNacl-macOS"; 396 | productReference = 52D6DA0F1BF000BD002C0205 /* TweetNacl.framework */; 397 | productType = "com.apple.product-type.framework"; 398 | }; 399 | DD7502791C68FCFC006590AF /* TweetNacl-macOS Tests */ = { 400 | isa = PBXNativeTarget; 401 | buildConfigurationList = DD7502821C68FCFC006590AF /* Build configuration list for PBXNativeTarget "TweetNacl-macOS Tests" */; 402 | buildPhases = ( 403 | DD7502761C68FCFC006590AF /* Sources */, 404 | DD7502771C68FCFC006590AF /* Frameworks */, 405 | DD7502781C68FCFC006590AF /* Resources */, 406 | ); 407 | buildRules = ( 408 | ); 409 | dependencies = ( 410 | DD7502811C68FCFC006590AF /* PBXTargetDependency */, 411 | ); 412 | name = "TweetNacl-macOS Tests"; 413 | productName = "TweetNacl-OS Tests"; 414 | productReference = DD75027A1C68FCFC006590AF /* TweetNacl-macOS Tests.xctest */; 415 | productType = "com.apple.product-type.bundle.unit-test"; 416 | }; 417 | DD75028C1C690C7A006590AF /* TweetNacl-tvOS Tests */ = { 418 | isa = PBXNativeTarget; 419 | buildConfigurationList = DD7502951C690C7A006590AF /* Build configuration list for PBXNativeTarget "TweetNacl-tvOS Tests" */; 420 | buildPhases = ( 421 | DD7502891C690C7A006590AF /* Sources */, 422 | DD75028A1C690C7A006590AF /* Frameworks */, 423 | DD75028B1C690C7A006590AF /* Resources */, 424 | ); 425 | buildRules = ( 426 | ); 427 | dependencies = ( 428 | DD7502941C690C7A006590AF /* PBXTargetDependency */, 429 | ); 430 | name = "TweetNacl-tvOS Tests"; 431 | productName = "TweetNacl-tvOS Tests"; 432 | productReference = DD75028D1C690C7A006590AF /* TweetNacl-tvOS Tests.xctest */; 433 | productType = "com.apple.product-type.bundle.unit-test"; 434 | }; 435 | /* End PBXNativeTarget section */ 436 | 437 | /* Begin PBXProject section */ 438 | 52D6D9731BEFF229002C0205 /* Project object */ = { 439 | isa = PBXProject; 440 | attributes = { 441 | LastSwiftUpdateCheck = 0720; 442 | LastUpgradeCheck = 0810; 443 | ORGANIZATIONNAME = Bitmark; 444 | TargetAttributes = { 445 | 52D6D97B1BEFF229002C0205 = { 446 | CreatedOnToolsVersion = 7.1; 447 | LastSwiftMigration = 0900; 448 | }; 449 | 52D6D9851BEFF229002C0205 = { 450 | CreatedOnToolsVersion = 7.1; 451 | LastSwiftMigration = 0900; 452 | }; 453 | 52D6D9E11BEFFF6E002C0205 = { 454 | CreatedOnToolsVersion = 7.1; 455 | LastSwiftMigration = 0800; 456 | }; 457 | 52D6D9EF1BEFFFBE002C0205 = { 458 | CreatedOnToolsVersion = 7.1; 459 | LastSwiftMigration = 0800; 460 | }; 461 | 52D6DA0E1BF000BD002C0205 = { 462 | CreatedOnToolsVersion = 7.1; 463 | LastSwiftMigration = 0800; 464 | }; 465 | DD7502791C68FCFC006590AF = { 466 | CreatedOnToolsVersion = 7.2.1; 467 | LastSwiftMigration = 0900; 468 | }; 469 | DD75028C1C690C7A006590AF = { 470 | CreatedOnToolsVersion = 7.2.1; 471 | LastSwiftMigration = 0900; 472 | }; 473 | }; 474 | }; 475 | buildConfigurationList = 52D6D9761BEFF229002C0205 /* Build configuration list for PBXProject "TweetNacl" */; 476 | compatibilityVersion = "Xcode 6.3"; 477 | developmentRegion = English; 478 | hasScannedForEncodings = 0; 479 | knownRegions = ( 480 | en, 481 | ); 482 | mainGroup = 52D6D9721BEFF229002C0205; 483 | productRefGroup = 52D6D97D1BEFF229002C0205 /* Products */; 484 | projectDirPath = ""; 485 | projectRoot = ""; 486 | targets = ( 487 | 52D6D97B1BEFF229002C0205 /* TweetNacl-iOS */, 488 | 52D6DA0E1BF000BD002C0205 /* TweetNacl-macOS */, 489 | 52D6D9E11BEFFF6E002C0205 /* TweetNacl-watchOS */, 490 | 52D6D9EF1BEFFFBE002C0205 /* TweetNacl-tvOS */, 491 | 52D6D9851BEFF229002C0205 /* TweetNacl-iOS Tests */, 492 | DD7502791C68FCFC006590AF /* TweetNacl-macOS Tests */, 493 | DD75028C1C690C7A006590AF /* TweetNacl-tvOS Tests */, 494 | ); 495 | }; 496 | /* End PBXProject section */ 497 | 498 | /* Begin PBXResourcesBuildPhase section */ 499 | 52D6D97A1BEFF229002C0205 /* Resources */ = { 500 | isa = PBXResourcesBuildPhase; 501 | buildActionMask = 2147483647; 502 | files = ( 503 | ); 504 | runOnlyForDeploymentPostprocessing = 0; 505 | }; 506 | 52D6D9841BEFF229002C0205 /* Resources */ = { 507 | isa = PBXResourcesBuildPhase; 508 | buildActionMask = 2147483647; 509 | files = ( 510 | 58B0C0BE1F99D78C00B49C81 /* SignTestData.json in Resources */, 511 | 58B0C0B51F99D78C00B49C81 /* BoxTestData.json in Resources */, 512 | 58B0C0C41F99D78C00B49C81 /* ScalarMultiTestData.json in Resources */, 513 | 58B0C0C71F99D78C00B49C81 /* SecretboxTestData.json in Resources */, 514 | ); 515 | runOnlyForDeploymentPostprocessing = 0; 516 | }; 517 | 52D6D9E01BEFFF6E002C0205 /* Resources */ = { 518 | isa = PBXResourcesBuildPhase; 519 | buildActionMask = 2147483647; 520 | files = ( 521 | ); 522 | runOnlyForDeploymentPostprocessing = 0; 523 | }; 524 | 52D6D9EE1BEFFFBE002C0205 /* Resources */ = { 525 | isa = PBXResourcesBuildPhase; 526 | buildActionMask = 2147483647; 527 | files = ( 528 | ); 529 | runOnlyForDeploymentPostprocessing = 0; 530 | }; 531 | 52D6DA0D1BF000BD002C0205 /* Resources */ = { 532 | isa = PBXResourcesBuildPhase; 533 | buildActionMask = 2147483647; 534 | files = ( 535 | ); 536 | runOnlyForDeploymentPostprocessing = 0; 537 | }; 538 | DD7502781C68FCFC006590AF /* Resources */ = { 539 | isa = PBXResourcesBuildPhase; 540 | buildActionMask = 2147483647; 541 | files = ( 542 | 58B0C0BF1F99D78C00B49C81 /* SignTestData.json in Resources */, 543 | 58B0C0B61F99D78C00B49C81 /* BoxTestData.json in Resources */, 544 | 58B0C0C51F99D78C00B49C81 /* ScalarMultiTestData.json in Resources */, 545 | 58B0C0C81F99D78C00B49C81 /* SecretboxTestData.json in Resources */, 546 | ); 547 | runOnlyForDeploymentPostprocessing = 0; 548 | }; 549 | DD75028B1C690C7A006590AF /* Resources */ = { 550 | isa = PBXResourcesBuildPhase; 551 | buildActionMask = 2147483647; 552 | files = ( 553 | 58B0C0C01F99D78C00B49C81 /* SignTestData.json in Resources */, 554 | 58B0C0B71F99D78C00B49C81 /* BoxTestData.json in Resources */, 555 | 58B0C0C61F99D78C00B49C81 /* ScalarMultiTestData.json in Resources */, 556 | 58B0C0C91F99D78C00B49C81 /* SecretboxTestData.json in Resources */, 557 | ); 558 | runOnlyForDeploymentPostprocessing = 0; 559 | }; 560 | /* End PBXResourcesBuildPhase section */ 561 | 562 | /* Begin PBXSourcesBuildPhase section */ 563 | 52D6D9771BEFF229002C0205 /* Sources */ = { 564 | isa = PBXSourcesBuildPhase; 565 | buildActionMask = 2147483647; 566 | files = ( 567 | 58B0C0D81F99EBCA00B49C81 /* TweetNacl.swift in Sources */, 568 | 58B0C0E51F99EF0D00B49C81 /* ctweetnacl.c in Sources */, 569 | 5816A3211F99F27300F580B2 /* Constant.swift in Sources */, 570 | ); 571 | runOnlyForDeploymentPostprocessing = 0; 572 | }; 573 | 52D6D9821BEFF229002C0205 /* Sources */ = { 574 | isa = PBXSourcesBuildPhase; 575 | buildActionMask = 2147483647; 576 | files = ( 577 | 58B0C0CA1F99D78C00B49C81 /* NaclSign_Tests.swift in Sources */, 578 | 58B0C0C11F99D78C00B49C81 /* NaclScalarMulti_Tests.swift in Sources */, 579 | 58B0C0B81F99D78C00B49C81 /* NaclBox_Tests.swift in Sources */, 580 | 58B0C0BB1F99D78C00B49C81 /* NaclSecretbox_Tests.swift in Sources */, 581 | ); 582 | runOnlyForDeploymentPostprocessing = 0; 583 | }; 584 | 52D6D9DD1BEFFF6E002C0205 /* Sources */ = { 585 | isa = PBXSourcesBuildPhase; 586 | buildActionMask = 2147483647; 587 | files = ( 588 | 58B0C0DA1F99EBCA00B49C81 /* TweetNacl.swift in Sources */, 589 | 58B0C0E71F99EF0D00B49C81 /* ctweetnacl.c in Sources */, 590 | 5816A3231F99F27300F580B2 /* Constant.swift in Sources */, 591 | ); 592 | runOnlyForDeploymentPostprocessing = 0; 593 | }; 594 | 52D6D9EB1BEFFFBE002C0205 /* Sources */ = { 595 | isa = PBXSourcesBuildPhase; 596 | buildActionMask = 2147483647; 597 | files = ( 598 | 58B0C0DB1F99EBCA00B49C81 /* TweetNacl.swift in Sources */, 599 | 58B0C0E81F99EF0D00B49C81 /* ctweetnacl.c in Sources */, 600 | 5816A3241F99F27300F580B2 /* Constant.swift in Sources */, 601 | ); 602 | runOnlyForDeploymentPostprocessing = 0; 603 | }; 604 | 52D6DA0A1BF000BD002C0205 /* Sources */ = { 605 | isa = PBXSourcesBuildPhase; 606 | buildActionMask = 2147483647; 607 | files = ( 608 | 58B0C0D91F99EBCA00B49C81 /* TweetNacl.swift in Sources */, 609 | 58B0C0E61F99EF0D00B49C81 /* ctweetnacl.c in Sources */, 610 | 5816A3221F99F27300F580B2 /* Constant.swift in Sources */, 611 | ); 612 | runOnlyForDeploymentPostprocessing = 0; 613 | }; 614 | DD7502761C68FCFC006590AF /* Sources */ = { 615 | isa = PBXSourcesBuildPhase; 616 | buildActionMask = 2147483647; 617 | files = ( 618 | 58B0C0CB1F99D78C00B49C81 /* NaclSign_Tests.swift in Sources */, 619 | 58B0C0C21F99D78C00B49C81 /* NaclScalarMulti_Tests.swift in Sources */, 620 | 58B0C0B91F99D78C00B49C81 /* NaclBox_Tests.swift in Sources */, 621 | 58B0C0BC1F99D78C00B49C81 /* NaclSecretbox_Tests.swift in Sources */, 622 | ); 623 | runOnlyForDeploymentPostprocessing = 0; 624 | }; 625 | DD7502891C690C7A006590AF /* Sources */ = { 626 | isa = PBXSourcesBuildPhase; 627 | buildActionMask = 2147483647; 628 | files = ( 629 | 58B0C0CC1F99D78C00B49C81 /* NaclSign_Tests.swift in Sources */, 630 | 58B0C0C31F99D78C00B49C81 /* NaclScalarMulti_Tests.swift in Sources */, 631 | 58B0C0BA1F99D78C00B49C81 /* NaclBox_Tests.swift in Sources */, 632 | 58B0C0BD1F99D78C00B49C81 /* NaclSecretbox_Tests.swift in Sources */, 633 | ); 634 | runOnlyForDeploymentPostprocessing = 0; 635 | }; 636 | /* End PBXSourcesBuildPhase section */ 637 | 638 | /* Begin PBXTargetDependency section */ 639 | 52D6D9891BEFF229002C0205 /* PBXTargetDependency */ = { 640 | isa = PBXTargetDependency; 641 | target = 52D6D97B1BEFF229002C0205 /* TweetNacl-iOS */; 642 | targetProxy = 52D6D9881BEFF229002C0205 /* PBXContainerItemProxy */; 643 | }; 644 | DD7502811C68FCFC006590AF /* PBXTargetDependency */ = { 645 | isa = PBXTargetDependency; 646 | target = 52D6DA0E1BF000BD002C0205 /* TweetNacl-macOS */; 647 | targetProxy = DD7502801C68FCFC006590AF /* PBXContainerItemProxy */; 648 | }; 649 | DD7502941C690C7A006590AF /* PBXTargetDependency */ = { 650 | isa = PBXTargetDependency; 651 | target = 52D6D9EF1BEFFFBE002C0205 /* TweetNacl-tvOS */; 652 | targetProxy = DD7502931C690C7A006590AF /* PBXContainerItemProxy */; 653 | }; 654 | /* End PBXTargetDependency section */ 655 | 656 | /* Begin XCBuildConfiguration section */ 657 | 52D6D98E1BEFF229002C0205 /* Debug */ = { 658 | isa = XCBuildConfiguration; 659 | buildSettings = { 660 | ALWAYS_SEARCH_USER_PATHS = NO; 661 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 662 | CLANG_CXX_LIBRARY = "libc++"; 663 | CLANG_ENABLE_MODULES = YES; 664 | CLANG_ENABLE_OBJC_ARC = YES; 665 | CLANG_WARN_BOOL_CONVERSION = YES; 666 | CLANG_WARN_CONSTANT_CONVERSION = YES; 667 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 668 | CLANG_WARN_EMPTY_BODY = YES; 669 | CLANG_WARN_ENUM_CONVERSION = YES; 670 | CLANG_WARN_INFINITE_RECURSION = YES; 671 | CLANG_WARN_INT_CONVERSION = YES; 672 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 673 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 674 | CLANG_WARN_UNREACHABLE_CODE = YES; 675 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 676 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 677 | COPY_PHASE_STRIP = NO; 678 | CURRENT_PROJECT_VERSION = 1; 679 | DEBUG_INFORMATION_FORMAT = dwarf; 680 | DEFINES_MODULE = YES; 681 | ENABLE_STRICT_OBJC_MSGSEND = YES; 682 | ENABLE_TESTABILITY = YES; 683 | GCC_C_LANGUAGE_STANDARD = gnu99; 684 | GCC_DYNAMIC_NO_PIC = NO; 685 | GCC_NO_COMMON_BLOCKS = YES; 686 | GCC_OPTIMIZATION_LEVEL = 0; 687 | GCC_PREPROCESSOR_DEFINITIONS = ( 688 | "DEBUG=1", 689 | "$(inherited)", 690 | ); 691 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 692 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 693 | GCC_WARN_UNDECLARED_SELECTOR = YES; 694 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 695 | GCC_WARN_UNUSED_FUNCTION = YES; 696 | GCC_WARN_UNUSED_VARIABLE = YES; 697 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 698 | MTL_ENABLE_DEBUG_INFO = YES; 699 | ONLY_ACTIVE_ARCH = YES; 700 | SDKROOT = iphoneos; 701 | SWIFT_INCLUDE_PATHS = "$(SRCROOT)/Sources"; 702 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 703 | SWIFT_VERSION = 4.0; 704 | TARGETED_DEVICE_FAMILY = "1,2"; 705 | VERSIONING_SYSTEM = "apple-generic"; 706 | VERSION_INFO_PREFIX = ""; 707 | }; 708 | name = Debug; 709 | }; 710 | 52D6D98F1BEFF229002C0205 /* Release */ = { 711 | isa = XCBuildConfiguration; 712 | buildSettings = { 713 | ALWAYS_SEARCH_USER_PATHS = NO; 714 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 715 | CLANG_CXX_LIBRARY = "libc++"; 716 | CLANG_ENABLE_MODULES = YES; 717 | CLANG_ENABLE_OBJC_ARC = YES; 718 | CLANG_WARN_BOOL_CONVERSION = YES; 719 | CLANG_WARN_CONSTANT_CONVERSION = YES; 720 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 721 | CLANG_WARN_EMPTY_BODY = YES; 722 | CLANG_WARN_ENUM_CONVERSION = YES; 723 | CLANG_WARN_INFINITE_RECURSION = YES; 724 | CLANG_WARN_INT_CONVERSION = YES; 725 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 726 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 727 | CLANG_WARN_UNREACHABLE_CODE = YES; 728 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 729 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 730 | COPY_PHASE_STRIP = NO; 731 | CURRENT_PROJECT_VERSION = 1; 732 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 733 | DEFINES_MODULE = YES; 734 | ENABLE_NS_ASSERTIONS = NO; 735 | ENABLE_STRICT_OBJC_MSGSEND = YES; 736 | GCC_C_LANGUAGE_STANDARD = gnu99; 737 | GCC_NO_COMMON_BLOCKS = YES; 738 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 739 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 740 | GCC_WARN_UNDECLARED_SELECTOR = YES; 741 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 742 | GCC_WARN_UNUSED_FUNCTION = YES; 743 | GCC_WARN_UNUSED_VARIABLE = YES; 744 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 745 | MTL_ENABLE_DEBUG_INFO = NO; 746 | SDKROOT = iphoneos; 747 | SWIFT_INCLUDE_PATHS = "$(SRCROOT)/Sources"; 748 | SWIFT_VERSION = 4.0; 749 | TARGETED_DEVICE_FAMILY = "1,2"; 750 | VALIDATE_PRODUCT = YES; 751 | VERSIONING_SYSTEM = "apple-generic"; 752 | VERSION_INFO_PREFIX = ""; 753 | }; 754 | name = Release; 755 | }; 756 | 52D6D9911BEFF229002C0205 /* Debug */ = { 757 | isa = XCBuildConfiguration; 758 | buildSettings = { 759 | APPLICATION_EXTENSION_API_ONLY = YES; 760 | CLANG_ENABLE_MODULES = YES; 761 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; 762 | DEFINES_MODULE = YES; 763 | DYLIB_COMPATIBILITY_VERSION = 1; 764 | DYLIB_CURRENT_VERSION = 1; 765 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 766 | INFOPLIST_FILE = Configs/TweetNacl.plist; 767 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 768 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 769 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 770 | ONLY_ACTIVE_ARCH = NO; 771 | PRODUCT_BUNDLE_IDENTIFIER = "com.TweetNacl.TweetNacl-iOS"; 772 | PRODUCT_NAME = TweetNacl; 773 | SKIP_INSTALL = YES; 774 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 775 | SWIFT_SWIFT3_OBJC_INFERENCE = On; 776 | SWIFT_VERSION = 4.0; 777 | }; 778 | name = Debug; 779 | }; 780 | 52D6D9921BEFF229002C0205 /* Release */ = { 781 | isa = XCBuildConfiguration; 782 | buildSettings = { 783 | APPLICATION_EXTENSION_API_ONLY = YES; 784 | CLANG_ENABLE_MODULES = YES; 785 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; 786 | DEFINES_MODULE = YES; 787 | DYLIB_COMPATIBILITY_VERSION = 1; 788 | DYLIB_CURRENT_VERSION = 1; 789 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 790 | INFOPLIST_FILE = Configs/TweetNacl.plist; 791 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 792 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 793 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 794 | PRODUCT_BUNDLE_IDENTIFIER = "com.TweetNacl.TweetNacl-iOS"; 795 | PRODUCT_NAME = TweetNacl; 796 | SKIP_INSTALL = YES; 797 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 798 | SWIFT_SWIFT3_OBJC_INFERENCE = On; 799 | SWIFT_VERSION = 4.0; 800 | }; 801 | name = Release; 802 | }; 803 | 52D6D9941BEFF229002C0205 /* Debug */ = { 804 | isa = XCBuildConfiguration; 805 | buildSettings = { 806 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 807 | CLANG_ENABLE_MODULES = YES; 808 | INFOPLIST_FILE = Configs/TweetNaclTests.plist; 809 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 810 | PRODUCT_BUNDLE_IDENTIFIER = "com.TweetNacl.TweetNacl-iOS-Tests"; 811 | PRODUCT_NAME = "$(TARGET_NAME)"; 812 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 813 | SWIFT_SWIFT3_OBJC_INFERENCE = On; 814 | SWIFT_VERSION = 4.0; 815 | }; 816 | name = Debug; 817 | }; 818 | 52D6D9951BEFF229002C0205 /* Release */ = { 819 | isa = XCBuildConfiguration; 820 | buildSettings = { 821 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 822 | CLANG_ENABLE_MODULES = YES; 823 | INFOPLIST_FILE = Configs/TweetNaclTests.plist; 824 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 825 | PRODUCT_BUNDLE_IDENTIFIER = "com.TweetNacl.TweetNacl-iOS-Tests"; 826 | PRODUCT_NAME = "$(TARGET_NAME)"; 827 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 828 | SWIFT_SWIFT3_OBJC_INFERENCE = On; 829 | SWIFT_VERSION = 4.0; 830 | }; 831 | name = Release; 832 | }; 833 | 52D6D9E81BEFFF6E002C0205 /* Debug */ = { 834 | isa = XCBuildConfiguration; 835 | buildSettings = { 836 | APPLICATION_EXTENSION_API_ONLY = YES; 837 | "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; 838 | DEFINES_MODULE = YES; 839 | DYLIB_COMPATIBILITY_VERSION = 1; 840 | DYLIB_CURRENT_VERSION = 1; 841 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 842 | INFOPLIST_FILE = Configs/TweetNacl.plist; 843 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 844 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 845 | PRODUCT_BUNDLE_IDENTIFIER = "com.TweetNacl.TweetNacl-watchOS"; 846 | PRODUCT_NAME = TweetNacl; 847 | SDKROOT = watchos; 848 | SKIP_INSTALL = YES; 849 | SWIFT_VERSION = 4.0; 850 | TARGETED_DEVICE_FAMILY = 4; 851 | WATCHOS_DEPLOYMENT_TARGET = 2.0; 852 | }; 853 | name = Debug; 854 | }; 855 | 52D6D9E91BEFFF6E002C0205 /* Release */ = { 856 | isa = XCBuildConfiguration; 857 | buildSettings = { 858 | APPLICATION_EXTENSION_API_ONLY = YES; 859 | "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; 860 | DEFINES_MODULE = YES; 861 | DYLIB_COMPATIBILITY_VERSION = 1; 862 | DYLIB_CURRENT_VERSION = 1; 863 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 864 | INFOPLIST_FILE = Configs/TweetNacl.plist; 865 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 866 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 867 | PRODUCT_BUNDLE_IDENTIFIER = "com.TweetNacl.TweetNacl-watchOS"; 868 | PRODUCT_NAME = TweetNacl; 869 | SDKROOT = watchos; 870 | SKIP_INSTALL = YES; 871 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 872 | SWIFT_VERSION = 4.0; 873 | TARGETED_DEVICE_FAMILY = 4; 874 | WATCHOS_DEPLOYMENT_TARGET = 2.0; 875 | }; 876 | name = Release; 877 | }; 878 | 52D6DA021BEFFFBE002C0205 /* Debug */ = { 879 | isa = XCBuildConfiguration; 880 | buildSettings = { 881 | APPLICATION_EXTENSION_API_ONLY = YES; 882 | "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; 883 | DEFINES_MODULE = YES; 884 | DYLIB_COMPATIBILITY_VERSION = 1; 885 | DYLIB_CURRENT_VERSION = 1; 886 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 887 | INFOPLIST_FILE = Configs/TweetNacl.plist; 888 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 889 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 890 | PRODUCT_BUNDLE_IDENTIFIER = "com.TweetNacl.TweetNacl-tvOS"; 891 | PRODUCT_NAME = TweetNacl; 892 | SDKROOT = appletvos; 893 | SKIP_INSTALL = YES; 894 | SWIFT_VERSION = 4.0; 895 | TARGETED_DEVICE_FAMILY = 3; 896 | TVOS_DEPLOYMENT_TARGET = 9.0; 897 | }; 898 | name = Debug; 899 | }; 900 | 52D6DA031BEFFFBE002C0205 /* Release */ = { 901 | isa = XCBuildConfiguration; 902 | buildSettings = { 903 | APPLICATION_EXTENSION_API_ONLY = YES; 904 | "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; 905 | DEFINES_MODULE = YES; 906 | DYLIB_COMPATIBILITY_VERSION = 1; 907 | DYLIB_CURRENT_VERSION = 1; 908 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 909 | INFOPLIST_FILE = Configs/TweetNacl.plist; 910 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 911 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 912 | PRODUCT_BUNDLE_IDENTIFIER = "com.TweetNacl.TweetNacl-tvOS"; 913 | PRODUCT_NAME = TweetNacl; 914 | SDKROOT = appletvos; 915 | SKIP_INSTALL = YES; 916 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 917 | SWIFT_VERSION = 4.0; 918 | TARGETED_DEVICE_FAMILY = 3; 919 | TVOS_DEPLOYMENT_TARGET = 9.0; 920 | }; 921 | name = Release; 922 | }; 923 | 52D6DA211BF000BD002C0205 /* Debug */ = { 924 | isa = XCBuildConfiguration; 925 | buildSettings = { 926 | APPLICATION_EXTENSION_API_ONLY = YES; 927 | CODE_SIGN_IDENTITY = "-"; 928 | COMBINE_HIDPI_IMAGES = YES; 929 | DEFINES_MODULE = YES; 930 | DYLIB_COMPATIBILITY_VERSION = 1; 931 | DYLIB_CURRENT_VERSION = 1; 932 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 933 | FRAMEWORK_VERSION = A; 934 | INFOPLIST_FILE = Configs/TweetNacl.plist; 935 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 936 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; 937 | MACOSX_DEPLOYMENT_TARGET = 10.10; 938 | PRODUCT_BUNDLE_IDENTIFIER = "com.TweetNacl.TweetNacl-macOS"; 939 | PRODUCT_NAME = TweetNacl; 940 | SDKROOT = macosx; 941 | SKIP_INSTALL = YES; 942 | SWIFT_VERSION = 4.0; 943 | }; 944 | name = Debug; 945 | }; 946 | 52D6DA221BF000BD002C0205 /* Release */ = { 947 | isa = XCBuildConfiguration; 948 | buildSettings = { 949 | APPLICATION_EXTENSION_API_ONLY = YES; 950 | CODE_SIGN_IDENTITY = "-"; 951 | COMBINE_HIDPI_IMAGES = YES; 952 | DEFINES_MODULE = YES; 953 | DYLIB_COMPATIBILITY_VERSION = 1; 954 | DYLIB_CURRENT_VERSION = 1; 955 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 956 | FRAMEWORK_VERSION = A; 957 | INFOPLIST_FILE = Configs/TweetNacl.plist; 958 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 959 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; 960 | MACOSX_DEPLOYMENT_TARGET = 10.10; 961 | PRODUCT_BUNDLE_IDENTIFIER = "com.TweetNacl.TweetNacl-macOS"; 962 | PRODUCT_NAME = TweetNacl; 963 | SDKROOT = macosx; 964 | SKIP_INSTALL = YES; 965 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 966 | SWIFT_VERSION = 4.0; 967 | }; 968 | name = Release; 969 | }; 970 | DD7502831C68FCFC006590AF /* Debug */ = { 971 | isa = XCBuildConfiguration; 972 | buildSettings = { 973 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 974 | CLANG_ENABLE_MODULES = YES; 975 | CODE_SIGN_IDENTITY = "-"; 976 | COMBINE_HIDPI_IMAGES = YES; 977 | INFOPLIST_FILE = Configs/TweetNaclTests.plist; 978 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; 979 | MACOSX_DEPLOYMENT_TARGET = 10.11; 980 | PRODUCT_BUNDLE_IDENTIFIER = "com.TweetNacl.TweetNacl-macOS-Tests"; 981 | PRODUCT_NAME = "$(TARGET_NAME)"; 982 | SDKROOT = macosx; 983 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 984 | SWIFT_VERSION = 4.0; 985 | }; 986 | name = Debug; 987 | }; 988 | DD7502841C68FCFC006590AF /* Release */ = { 989 | isa = XCBuildConfiguration; 990 | buildSettings = { 991 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 992 | CLANG_ENABLE_MODULES = YES; 993 | CODE_SIGN_IDENTITY = "-"; 994 | COMBINE_HIDPI_IMAGES = YES; 995 | INFOPLIST_FILE = Configs/TweetNaclTests.plist; 996 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; 997 | MACOSX_DEPLOYMENT_TARGET = 10.11; 998 | PRODUCT_BUNDLE_IDENTIFIER = "com.TweetNacl.TweetNacl-macOS-Tests"; 999 | PRODUCT_NAME = "$(TARGET_NAME)"; 1000 | SDKROOT = macosx; 1001 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 1002 | SWIFT_VERSION = 4.0; 1003 | }; 1004 | name = Release; 1005 | }; 1006 | DD7502961C690C7A006590AF /* Debug */ = { 1007 | isa = XCBuildConfiguration; 1008 | buildSettings = { 1009 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 1010 | CLANG_ENABLE_MODULES = YES; 1011 | INFOPLIST_FILE = Configs/TweetNaclTests.plist; 1012 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 1013 | PRODUCT_BUNDLE_IDENTIFIER = "com.TweetNacl.TweetNacl-tvOS-Tests"; 1014 | PRODUCT_NAME = "$(TARGET_NAME)"; 1015 | SDKROOT = appletvos; 1016 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 1017 | SWIFT_VERSION = 4.0; 1018 | TVOS_DEPLOYMENT_TARGET = 9.1; 1019 | }; 1020 | name = Debug; 1021 | }; 1022 | DD7502971C690C7A006590AF /* Release */ = { 1023 | isa = XCBuildConfiguration; 1024 | buildSettings = { 1025 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 1026 | CLANG_ENABLE_MODULES = YES; 1027 | INFOPLIST_FILE = Configs/TweetNaclTests.plist; 1028 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 1029 | PRODUCT_BUNDLE_IDENTIFIER = "com.TweetNacl.TweetNacl-tvOS-Tests"; 1030 | PRODUCT_NAME = "$(TARGET_NAME)"; 1031 | SDKROOT = appletvos; 1032 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 1033 | SWIFT_VERSION = 4.0; 1034 | TVOS_DEPLOYMENT_TARGET = 9.1; 1035 | }; 1036 | name = Release; 1037 | }; 1038 | /* End XCBuildConfiguration section */ 1039 | 1040 | /* Begin XCConfigurationList section */ 1041 | 52D6D9761BEFF229002C0205 /* Build configuration list for PBXProject "TweetNacl" */ = { 1042 | isa = XCConfigurationList; 1043 | buildConfigurations = ( 1044 | 52D6D98E1BEFF229002C0205 /* Debug */, 1045 | 52D6D98F1BEFF229002C0205 /* Release */, 1046 | ); 1047 | defaultConfigurationIsVisible = 0; 1048 | defaultConfigurationName = Release; 1049 | }; 1050 | 52D6D9901BEFF229002C0205 /* Build configuration list for PBXNativeTarget "TweetNacl-iOS" */ = { 1051 | isa = XCConfigurationList; 1052 | buildConfigurations = ( 1053 | 52D6D9911BEFF229002C0205 /* Debug */, 1054 | 52D6D9921BEFF229002C0205 /* Release */, 1055 | ); 1056 | defaultConfigurationIsVisible = 0; 1057 | defaultConfigurationName = Release; 1058 | }; 1059 | 52D6D9931BEFF229002C0205 /* Build configuration list for PBXNativeTarget "TweetNacl-iOS Tests" */ = { 1060 | isa = XCConfigurationList; 1061 | buildConfigurations = ( 1062 | 52D6D9941BEFF229002C0205 /* Debug */, 1063 | 52D6D9951BEFF229002C0205 /* Release */, 1064 | ); 1065 | defaultConfigurationIsVisible = 0; 1066 | defaultConfigurationName = Release; 1067 | }; 1068 | 52D6D9E71BEFFF6E002C0205 /* Build configuration list for PBXNativeTarget "TweetNacl-watchOS" */ = { 1069 | isa = XCConfigurationList; 1070 | buildConfigurations = ( 1071 | 52D6D9E81BEFFF6E002C0205 /* Debug */, 1072 | 52D6D9E91BEFFF6E002C0205 /* Release */, 1073 | ); 1074 | defaultConfigurationIsVisible = 0; 1075 | defaultConfigurationName = Release; 1076 | }; 1077 | 52D6DA011BEFFFBE002C0205 /* Build configuration list for PBXNativeTarget "TweetNacl-tvOS" */ = { 1078 | isa = XCConfigurationList; 1079 | buildConfigurations = ( 1080 | 52D6DA021BEFFFBE002C0205 /* Debug */, 1081 | 52D6DA031BEFFFBE002C0205 /* Release */, 1082 | ); 1083 | defaultConfigurationIsVisible = 0; 1084 | defaultConfigurationName = Release; 1085 | }; 1086 | 52D6DA201BF000BD002C0205 /* Build configuration list for PBXNativeTarget "TweetNacl-macOS" */ = { 1087 | isa = XCConfigurationList; 1088 | buildConfigurations = ( 1089 | 52D6DA211BF000BD002C0205 /* Debug */, 1090 | 52D6DA221BF000BD002C0205 /* Release */, 1091 | ); 1092 | defaultConfigurationIsVisible = 0; 1093 | defaultConfigurationName = Release; 1094 | }; 1095 | DD7502821C68FCFC006590AF /* Build configuration list for PBXNativeTarget "TweetNacl-macOS Tests" */ = { 1096 | isa = XCConfigurationList; 1097 | buildConfigurations = ( 1098 | DD7502831C68FCFC006590AF /* Debug */, 1099 | DD7502841C68FCFC006590AF /* Release */, 1100 | ); 1101 | defaultConfigurationIsVisible = 0; 1102 | defaultConfigurationName = Release; 1103 | }; 1104 | DD7502951C690C7A006590AF /* Build configuration list for PBXNativeTarget "TweetNacl-tvOS Tests" */ = { 1105 | isa = XCConfigurationList; 1106 | buildConfigurations = ( 1107 | DD7502961C690C7A006590AF /* Debug */, 1108 | DD7502971C690C7A006590AF /* Release */, 1109 | ); 1110 | defaultConfigurationIsVisible = 0; 1111 | defaultConfigurationName = Release; 1112 | }; 1113 | /* End XCConfigurationList section */ 1114 | }; 1115 | rootObject = 52D6D9731BEFF229002C0205 /* Project object */; 1116 | } 1117 | --------------------------------------------------------------------------------