Browse Source

Merge branch 'master' into develop

Marcin Krzyżanowski 7 years ago
parent
commit
1d60601b4d

+ 1 - 0
.github/CODEOWNERS

@@ -0,0 +1 @@
+*       @krzyzanowskim

+ 28 - 0
.github/ISSUE_TEMPLATE.md

@@ -0,0 +1,28 @@
+# Details
+
+- CryptoSwift version: 
+- Swift version: 
+- Platform version: 
+	- [ ] iOS/tvOS/watchOS
+	- [ ] macOS
+	- [ ] Linux
+- Installation: 
+	- [ ] CocoaPods
+	- [ ] Carthage
+	- [ ] Swift Package Manager
+	- [ ] Manual
+- [ ] [I'm a supporter](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=92Z6U3LBHF9J4).
+
+# Description
+
+
+# Steps to reproduce
+
+
+Sample code:
+
+```swift
+import CryptoSwift
+
+
+```

+ 12 - 0
.github/PULL_REQUEST_TEMPLATE.md

@@ -0,0 +1,12 @@
+Fixes #
+
+Checklist:
+- [ ] Pull request against a `develop` branch.
+- [ ] Correct file headers (see CONTRIBUTING.md).
+- [ ] Formatted with [SwiftFormat](https://github.com/nicklockwood/SwiftFormat).
+- [ ] Tests added.
+
+Changes proposed in this pull request:
+- 
+- 
+- 

+ 1 - 0
.gitignore

@@ -18,3 +18,4 @@ timeline.xctimeline
 
 /Framework
 .DS_Store
+Carthage/Build

+ 1 - 1
.swift-version

@@ -1 +1 @@
-4.0
+4.0.3

+ 5 - 0
CHANGELOG

@@ -1,3 +1,8 @@
+0.8.1
+- Adds Data(hex:) helper.
+- Adds HKDF (HMAC-based Extract-and-Expand Key Derivation Function)
+- Prevent ChaCha overflow error
+
 0.8.0
 - Adds SHA3 Keccak variants
 - Adds String.bytes helper to convert String to array of bytes

+ 28 - 0
CONTRIBUTING.md

@@ -0,0 +1,28 @@
+By submitting a pull request, you represent that you have the right to license
+your contribution to Marcin Krzyżanowski and the community, and agree by submitting the patch
+that your contributions are licensed under the CryptoSwift project license.
+
+---
+
+Before submitting the pull request, please make sure you have tested your changes.
+
+---
+
+For new files, please use the correct file header:
+
+```
+//
+//  CryptoSwift
+//
+//  Copyright (C) 2014-2017 Marcin Krzyżanowski <marcin@krzyzanowskim.com>
+//  This software is provided 'as-is', without any express or implied warranty.
+//
+//  In no event will the authors be held liable for any damages arising from the use of this software.
+//
+//  Permission is granted to anyone to use this software for any purpose,including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
+//
+//  - The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation is required.
+//  - Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+//  - This notice may not be removed or altered from any source or binary distribution.
+//
+```

+ 3 - 2
CryptoSwift.podspec

@@ -1,13 +1,14 @@
 Pod::Spec.new do |s|
   s.name         = "CryptoSwift"
-  s.version      = "0.8.0"
+  s.version      = "0.8.1"
   s.source       = { :git => "https://github.com/krzyzanowskim/CryptoSwift.git", :tag => "#{s.version}" }
-  s.summary      = "Cryptography in Swift. SHA, MD5, CRC, PBKDF, Poly1305, HMAC, ChaCha20, Rabbit, Blowfish, AES."
+  s.summary      = "Cryptography in Swift. SHA, MD5, CRC, PBKDF, Poly1305, HMAC, HDKF, ChaCha20, Rabbit, Blowfish, AES."
   s.description  = "Cryptography functions and helpers for Swift implemented in Swift. SHA-1, SHA-2, SHA-3, MD5, PBKDF1, PBKDF2, CRC, Poly1305, HMAC, ChaCha20, Rabbit, Blowfish, AES"
   s.homepage     = "https://github.com/krzyzanowskim/CryptoSwift"
   s.license      = {:type => "Attribution License", :file => "LICENSE"}
   s.authors      = {'Marcin Krzyżanowski' => 'marcin@krzyzanowskim.com'}
   s.social_media_url   = "https://twitter.com/krzyzanowskim"
+  s.swift_version = "4.0"
   s.ios.deployment_target = "8.0"
   s.osx.deployment_target = "10.9"
   s.watchos.deployment_target = "2.0"

+ 1 - 0
CryptoSwift.xcodeproj/xcshareddata/IDETemplateMacros.plist

@@ -0,0 +1 @@
+../../IDETemplateMacros.plist

+ 27 - 0
IDETemplateMacros.plist

@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+<!--
+	This is a shared macro used in all internal Xcode projects.
+	This file is linked from <PROJECT>.xcodeproj/xcshareddata/IDETemplateMacros.plist.
+	Keep in mind that public Xcode projects have slightly different copyright notice, thus they might be using different template macros.
+-->
+	<key>FILEHEADER</key>
+	<string>
+//
+//  CryptoSwift
+//
+//  Copyright © ___YEAR___ Marcin Krzyżanowski <marcin@krzyzanowskim.com>
+//  This software is provided 'as-is', without any express or implied warranty.
+//
+//  In no event will the authors be held liable for any damages arising from the use of this software.
+//
+//  Permission is granted to anyone to use this software for any purpose,including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
+//
+//  - The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation is required.
+//  - Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+//  - This notice may not be removed or altered from any source or binary distribution.
+//</string>
+</dict>
+</plist>

+ 1 - 0
LICENSE

@@ -8,3 +8,4 @@ Permission is granted to anyone to use this software for any purpose,including c
 - The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation is required.
 - Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
 - This notice may not be removed or altered from any source or binary distribution.
+- Redistributions of any form whatsoever must retain the following acknowledgment: 'This product includes software developed by the "Marcin Krzyzanowski" (http://krzyzanowskim.com/).'

+ 8 - 4
README.md

@@ -1,5 +1,5 @@
-[![Platform](https://img.shields.io/badge/Platforms-ios%20%7C%20macos%20%7C%20watchos%20%7C%20tvos%20%7C%20linux-4E4E4E.svg?colorA=EF5138)](http://cocoadocs.org/docsets/CryptoSwift)
-[![Swift support](https://img.shields.io/badge/Swift-3.1%20%7C%203.2%20%7C%204.0-lightgrey.svg?colorA=EF5138&colorB=4E4E4E)](#swift-versions-support)
+[![Platform](https://img.shields.io/badge/Platforms-iOS%20%7C%20macOS%20%7C%20watchOS%20%7C%20tvOS%20%7C%20Linux-4E4E4E.svg?colorA=28a745)](#installation)
+[![Swift support](https://img.shields.io/badge/Swift-3.1%20%7C%203.2%20%7C%204.0-lightgrey.svg?colorA=28a745&colorB=4E4E4E)](#swift-versions-support)
 [![CocoaPods Compatible](https://img.shields.io/cocoapods/v/CryptoSwift.svg?style=flat&label=CocoaPods)](https://cocoapods.org/pods/CryptoSwift)
 [![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-brightgreen.svg?style=flat&colorB=64A5DE)](https://github.com/apple/swift-package-manager)
 [![Swift Package Manager compatible](https://img.shields.io/badge/SPM-compatible-brightgreen.svg?style=flat&colorB=64A5DE)](https://github.com/apple/swift-package-manager)
@@ -30,6 +30,9 @@ Good mood
 - Support for incremental updates (stream, ...)
 - iOS, macOS, AppleTV, watchOS, Linux support
 
+## Donation
+[![paypal](https://www.paypalobjects.com/en_US/i/btn/btn_donate_LG.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=92Z6U3LBHF9J4) to make the CryptoSwift awesome! Thank you.
+
 #### Hash (Digest)
 - [MD5](http://tools.ietf.org/html/rfc1321)
 - [SHA1](http://tools.ietf.org/html/rfc3174)
@@ -152,7 +155,7 @@ You can use [Swift Package Manager](https://swift.org/package-manager/) and spec
 
 ```swift
 dependencies: [
-    .Package(url: "https://github.com/krzyzanowskim/CryptoSwift.git", majorVersion: 0)
+    .package(url: "https://github.com/krzyzanowskim/CryptoSwift.git", .upToNextMinor(from: "0.8.0"))
 ]
 ```
 
@@ -160,7 +163,7 @@ or more strict
 
 ```swift
 dependencies: [
-    .Package(url: "https://github.com/krzyzanowskim/CryptoSwift.git", "0.7.2"),
+    .package(url: "https://github.com/krzyzanowskim/CryptoSwift.git", .exact("0.8.0"))
 ]
 ```
 
@@ -422,6 +425,7 @@ Permission is granted to anyone to use this software for any purpose, including
 - The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, **an acknowledgment in the product documentation is required**.
 - Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
 - This notice may not be removed or altered from any source or binary distribution.
+- Redistributions of any form whatsoever must retain the following acknowledgment: 'This product includes software developed by the "Marcin Krzyzanowski" (http://krzyzanowskim.com/).'
 
 ## Changelog
 

+ 1 - 1
Sources/CryptoSwift/AES.Cryptors.swift

@@ -89,7 +89,7 @@ extension AES {
         }
 
         public mutating func update(withBytes bytes: ArraySlice<UInt8>, isLast: Bool = false) throws -> Array<UInt8> {
-            // prepend "offset" number of bytes at the begining
+            // prepend "offset" number of bytes at the beginning
             if offset > 0 {
                 accumulated += Array<UInt8>(repeating: 0, count: offset) + bytes
                 offsetToRemove = offset

+ 3 - 3
Sources/CryptoSwift/AES.swift

@@ -329,7 +329,7 @@ public final class AES: BlockCipher {
             UInt8(b1 & 0xff), UInt8((b1 >> 8) & 0xff), UInt8((b1 >> 16) & 0xff), UInt8((b1 >> 24) & 0xff),
             UInt8(b2 & 0xff), UInt8((b2 >> 8) & 0xff), UInt8((b2 >> 16) & 0xff), UInt8((b2 >> 24) & 0xff),
             UInt8(b3 & 0xff), UInt8((b3 >> 8) & 0xff), UInt8((b3 >> 16) & 0xff), UInt8((b3 >> 24) & 0xff),
-            ]
+        ]
         return result
     }
 }
@@ -490,7 +490,7 @@ extension AES: Cipher {
     public func encrypt(_ bytes: ArraySlice<UInt8>) throws -> Array<UInt8> {
         let chunks = bytes.batched(by: AES.blockSize)
 
-        var oneTimeCryptor = try self.makeEncryptor()
+        var oneTimeCryptor = try makeEncryptor()
         var out = Array<UInt8>(reserveCapacity: bytes.count)
         for chunk in chunks {
             out += try oneTimeCryptor.update(withBytes: chunk, isLast: false)
@@ -510,7 +510,7 @@ extension AES: Cipher {
             throw Error.dataPaddingRequired
         }
 
-        var oneTimeCryptor = try self.makeDecryptor()
+        var oneTimeCryptor = try makeDecryptor()
         let chunks = bytes.batched(by: AES.blockSize)
         if chunks.isEmpty {
             throw Error.invalidData

+ 1 - 1
Sources/CryptoSwift/ChaCha20.swift

@@ -292,7 +292,7 @@ extension ChaCha20 {
         }
 
         public mutating func update(withBytes bytes: ArraySlice<UInt8>, isLast: Bool = true) throws -> Array<UInt8> {
-            // prepend "offset" number of bytes at the begining
+            // prepend "offset" number of bytes at the beginning
             if offset > 0 {
                 accumulated += Array<UInt8>(repeating: 0, count: offset) + bytes
                 offsetToRemove = offset

+ 1 - 3
Sources/CryptoSwift/SHA3.swift

@@ -38,7 +38,6 @@ public final class SHA3: DigestType {
     public let markByte: UInt8
 
     fileprivate var accumulated = Array<UInt8>()
-    fileprivate var processedBytesTotalCount: Int = 0
     fileprivate var accumulatedHash: Array<UInt64>
 
     public enum Variant {
@@ -256,7 +255,7 @@ extension SHA3: Updatable {
 
         if isLast {
             // Add padding
-            let markByteIndex = processedBytesTotalCount &+ accumulated.count
+            let markByteIndex = accumulated.count
             if accumulated.count == 0 || accumulated.count % blockSize != 0 {
                 let r = blockSize * 8
                 let q = (r / 8) - (accumulated.count % (r / 8))
@@ -274,7 +273,6 @@ extension SHA3: Updatable {
             }
         }
         accumulated.removeFirst(processedBytes)
-        processedBytesTotalCount += processedBytes
 
         // TODO: verify performance, reduce vs for..in
         let result = accumulatedHash.reduce(Array<UInt8>()) { (result, value) -> Array<UInt8> in

+ 11 - 2
Tests/CryptoSwiftTests/AESTests.swift

@@ -1,9 +1,18 @@
 //
 //  CryptoSwift
 //
-//  Created by Marcin Krzyzanowski on 27/12/14.
-//  Copyright (C) 2014-2017 Krzyzanowski. All rights reserved.
+//  Copyright (C) 2014-2017 Marcin Krzyżanowski <marcin@krzyzanowskim.com>
+//  This software is provided 'as-is', without any express or implied warranty.
 //
+//  In no event will the authors be held liable for any damages arising from the use of this software.
+//
+//  Permission is granted to anyone to use this software for any purpose,including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
+//
+//  - The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation is required.
+//  - Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+//  - This notice may not be removed or altered from any source or binary distribution.
+//
+
 import XCTest
 import Foundation
 @testable import CryptoSwift

+ 10 - 2
Tests/CryptoSwiftTests/Access.swift

@@ -1,8 +1,16 @@
 //
 //  CryptoSwift
 //
-//  Created by Marcin Krzyzanowski on 06/08/16.
-//  Copyright © 2016 Marcin Krzyzanowski. All rights reserved.
+//  Copyright (C) 2014-2017 Marcin Krzyżanowski <marcin@krzyzanowskim.com>
+//  This software is provided 'as-is', without any express or implied warranty.
+//
+//  In no event will the authors be held liable for any damages arising from the use of this software.
+//
+//  Permission is granted to anyone to use this software for any purpose,including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
+//
+//  - The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation is required.
+//  - Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+//  - This notice may not be removed or altered from any source or binary distribution.
 //
 
 import XCTest

+ 11 - 3
Tests/CryptoSwiftTests/BlowfishTests.swift

@@ -1,12 +1,20 @@
 //
 //  CryptoSwift
 //
-//  Created by Marcin Krzyzanowski on 26/10/16.
-//  Copyright © 2016 Marcin Krzyzanowski. All rights reserved.
+//  Copyright (C) 2014-2017 Marcin Krzyżanowski <marcin@krzyzanowskim.com>
+//  This software is provided 'as-is', without any express or implied warranty.
 //
-// Test vector from http://www.schneier.com/code/vectors.txt
+//  In no event will the authors be held liable for any damages arising from the use of this software.
+//
+//  Permission is granted to anyone to use this software for any purpose,including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
+//
+//  - The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation is required.
+//  - Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+//  - This notice may not be removed or altered from any source or binary distribution.
 //
 
+// Test vector from http://www.schneier.com/code/vectors.txt
+
 import XCTest
 @testable import CryptoSwift
 

+ 10 - 3
Tests/CryptoSwiftTests/Bridging.h

@@ -1,9 +1,16 @@
 //
-//  Bridging.h
 //  CryptoSwift
 //
-//  Created by Marcin Krzyzanowski on 04/02/15.
-//  Copyright (c) 2015 Marcin Krzyzanowski. All rights reserved.
+//  Copyright (C) 2014-2017 Marcin Krzyżanowski <marcin@krzyzanowskim.com>
+//  This software is provided 'as-is', without any express or implied warranty.
+//
+//  In no event will the authors be held liable for any damages arising from the use of this software.
+//
+//  Permission is granted to anyone to use this software for any purpose,including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
+//
+//  - The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation is required.
+//  - Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+//  - This notice may not be removed or altered from any source or binary distribution.
 //
 
 #ifndef CryptoSwift_Bridging_h

+ 11 - 2
Tests/CryptoSwiftTests/ChaCha20Tests.swift

@@ -1,9 +1,18 @@
 //
 //  CryptoSwift
 //
-//  Created by Marcin Krzyzanowski on 27/12/14.
-//  Copyright (C) 2014-2017 Krzyzanowski. All rights reserved.
+//  Copyright (C) 2014-2017 Marcin Krzyżanowski <marcin@krzyzanowskim.com>
+//  This software is provided 'as-is', without any express or implied warranty.
 //
+//  In no event will the authors be held liable for any damages arising from the use of this software.
+//
+//  Permission is granted to anyone to use this software for any purpose,including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
+//
+//  - The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation is required.
+//  - Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+//  - This notice may not be removed or altered from any source or binary distribution.
+//
+
 import XCTest
 import Foundation
 @testable import CryptoSwift

+ 12 - 3
Tests/CryptoSwiftTests/DigestTests.swift

@@ -1,9 +1,18 @@
 //
-//  CryptoSwiftTests
+//  CryptoSwift
 //
-//  Created by Marcin Krzyzanowski on 06/07/14.
-//  Copyright (C) 2014-2017 Krzyzanowski. All rights reserved.
+//  Copyright (C) 2014-2017 Marcin Krzyżanowski <marcin@krzyzanowskim.com>
+//  This software is provided 'as-is', without any express or implied warranty.
 //
+//  In no event will the authors be held liable for any damages arising from the use of this software.
+//
+//  Permission is granted to anyone to use this software for any purpose,including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
+//
+//  - The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation is required.
+//  - Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+//  - This notice may not be removed or altered from any source or binary distribution.
+//
+
 // http://www.di-mgt.com.au/sha_testvectors.html (http://csrc.nist.gov/groups/ST/toolkit/documents/Examples/SHA_All.pdf)
 //
 

+ 10 - 2
Tests/CryptoSwiftTests/Error+Extension.swift

@@ -1,8 +1,16 @@
 //
 //  CryptoSwift
 //
-//  Created by Michael Ledin on 22.08.16.
-//  Copyright © 2016 Marcin Krzyzanowski. All rights reserved.
+//  Copyright (C) 2014-2017 Marcin Krzyżanowski <marcin@krzyzanowskim.com>
+//  This software is provided 'as-is', without any express or implied warranty.
+//
+//  In no event will the authors be held liable for any damages arising from the use of this software.
+//
+//  Permission is granted to anyone to use this software for any purpose,including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
+//
+//  - The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation is required.
+//  - Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+//  - This notice may not be removed or altered from any source or binary distribution.
 //
 
 import Foundation

+ 11 - 2
Tests/CryptoSwiftTests/ExtensionsTest.swift

@@ -1,9 +1,18 @@
 //
 //  CryptoSwift
 //
-//  Created by Marcin Krzyzanowski on 15/08/14.
-//  Copyright (C) 2014-2017 Krzyzanowski. All rights reserved.
+//  Copyright (C) 2014-2017 Marcin Krzyżanowski <marcin@krzyzanowskim.com>
+//  This software is provided 'as-is', without any express or implied warranty.
 //
+//  In no event will the authors be held liable for any damages arising from the use of this software.
+//
+//  Permission is granted to anyone to use this software for any purpose,including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
+//
+//  - The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation is required.
+//  - Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+//  - This notice may not be removed or altered from any source or binary distribution.
+//
+
 import XCTest
 import Foundation
 @testable import CryptoSwift

+ 10 - 2
Tests/CryptoSwiftTests/HKDFTests.swift

@@ -1,8 +1,16 @@
 //
 //  CryptoSwift
 //
-//  Created by Alexey Komnin on 11/13/17.
-//  Copyright © 2017 Marcin Krzyzanowski. All rights reserved.
+//  Copyright (C) 2014-2017 Marcin Krzyżanowski <marcin@krzyzanowskim.com>
+//  This software is provided 'as-is', without any express or implied warranty.
+//
+//  In no event will the authors be held liable for any damages arising from the use of this software.
+//
+//  Permission is granted to anyone to use this software for any purpose,including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
+//
+//  - The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation is required.
+//  - Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+//  - This notice may not be removed or altered from any source or binary distribution.
 //
 
 import XCTest

+ 11 - 2
Tests/CryptoSwiftTests/HMACTests.swift

@@ -1,9 +1,18 @@
 //
 //  CryptoSwift
 //
-//  Created by Marcin Krzyzanowski on 29/08/14.
-//  Copyright (c) 2015 Marcin Krzyzanowski. All rights reserved.
+//  Copyright (C) 2014-2017 Marcin Krzyżanowski <marcin@krzyzanowskim.com>
+//  This software is provided 'as-is', without any express or implied warranty.
 //
+//  In no event will the authors be held liable for any damages arising from the use of this software.
+//
+//  Permission is granted to anyone to use this software for any purpose,including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
+//
+//  - The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation is required.
+//  - Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+//  - This notice may not be removed or altered from any source or binary distribution.
+//
+
 import XCTest
 @testable import CryptoSwift
 

+ 10 - 2
Tests/CryptoSwiftTests/PBKDF.swift

@@ -1,8 +1,16 @@
 //
 //  CryptoSwift
 //
-//  Created by Marcin Krzyzanowski on 04/04/16.
-//  Copyright © 2016 Marcin Krzyzanowski. All rights reserved.
+//  Copyright (C) 2014-2017 Marcin Krzyżanowski <marcin@krzyzanowskim.com>
+//  This software is provided 'as-is', without any express or implied warranty.
+//
+//  In no event will the authors be held liable for any damages arising from the use of this software.
+//
+//  Permission is granted to anyone to use this software for any purpose,including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
+//
+//  - The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation is required.
+//  - Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+//  - This notice may not be removed or altered from any source or binary distribution.
 //
 
 import XCTest

+ 11 - 2
Tests/CryptoSwiftTests/PaddingTests.swift

@@ -1,9 +1,18 @@
 //
 //  CryptoSwift
 //
-//  Created by Marcin Krzyzanowski on 27/12/14.
-//  Copyright (C) 2014-2017 Krzyzanowski. All rights reserved.
+//  Copyright (C) 2014-2017 Marcin Krzyżanowski <marcin@krzyzanowskim.com>
+//  This software is provided 'as-is', without any express or implied warranty.
 //
+//  In no event will the authors be held liable for any damages arising from the use of this software.
+//
+//  Permission is granted to anyone to use this software for any purpose,including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
+//
+//  - The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation is required.
+//  - Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+//  - This notice may not be removed or altered from any source or binary distribution.
+//
+
 import XCTest
 @testable import CryptoSwift
 

+ 11 - 2
Tests/CryptoSwiftTests/Poly1305Tests.swift

@@ -1,9 +1,18 @@
 //
 //  CryptoSwift
 //
-//  Created by Marcin Krzyzanowski on 29/08/14.
-//  Copyright (C) 2014-2017 Krzyzanowski. All rights reserved.
+//  Copyright (C) 2014-2017 Marcin Krzyżanowski <marcin@krzyzanowskim.com>
+//  This software is provided 'as-is', without any express or implied warranty.
 //
+//  In no event will the authors be held liable for any damages arising from the use of this software.
+//
+//  Permission is granted to anyone to use this software for any purpose,including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
+//
+//  - The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation is required.
+//  - Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+//  - This notice may not be removed or altered from any source or binary distribution.
+//
+
 import XCTest
 import Foundation
 @testable import CryptoSwift

+ 10 - 2
Tests/CryptoSwiftTests/RabbitTests.swift

@@ -1,8 +1,16 @@
 //
 //  CryptoSwift
 //
-//  Created by Dima Kalachov on 13/11/15.
-//  Copyright © 2015 Marcin Krzyzanowski. All rights reserved.
+//  Copyright (C) 2014-2017 Marcin Krzyżanowski <marcin@krzyzanowskim.com>
+//  This software is provided 'as-is', without any express or implied warranty.
+//
+//  In no event will the authors be held liable for any damages arising from the use of this software.
+//
+//  Permission is granted to anyone to use this software for any purpose,including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
+//
+//  - The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation is required.
+//  - Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+//  - This notice may not be removed or altered from any source or binary distribution.
 //
 
 import XCTest

+ 10 - 2
Tests/CryptoSwiftTests/RandomBytesSequenceTests.swift

@@ -1,8 +1,16 @@
 //
 //  CryptoSwift
 //
-//  Created by Marcin Krzyzanowski on 10/10/16.
-//  Copyright © 2016 Marcin Krzyzanowski. All rights reserved.
+//  Copyright (C) 2014-2017 Marcin Krzyżanowski <marcin@krzyzanowskim.com>
+//  This software is provided 'as-is', without any express or implied warranty.
+//
+//  In no event will the authors be held liable for any damages arising from the use of this software.
+//
+//  Permission is granted to anyone to use this software for any purpose,including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
+//
+//  - The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation is required.
+//  - Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+//  - This notice may not be removed or altered from any source or binary distribution.
 //
 
 import XCTest