فهرست منبع

PKCS7 -> PKCS7.Padding() Update headers.

Marcin Krzyżanowski 8 سال پیش
والد
کامیت
20b9082fd5
67فایلهای تغییر یافته به همراه116 افزوده شده و 93 حذف شده
  1. 11 7
      CryptoSwift.xcodeproj/project.pbxproj
  2. 3 3
      Sources/CryptoSwift/AES.swift
  3. 1 1
      Sources/CryptoSwift/Array+Extension.swift
  4. 1 1
      Sources/CryptoSwift/Authenticator.swift
  5. 1 1
      Sources/CryptoSwift/BatchedCollection.swift
  6. 1 1
      Sources/CryptoSwift/Bit.swift
  7. 1 1
      Sources/CryptoSwift/BlockCipher.swift
  8. 1 1
      Sources/CryptoSwift/BlockMode/BlockMode.swift
  9. 1 1
      Sources/CryptoSwift/BlockMode/BlockModeOptions.swift
  10. 1 1
      Sources/CryptoSwift/BlockMode/BlockModeWorker.swift
  11. 1 1
      Sources/CryptoSwift/BlockMode/CBC.swift
  12. 1 1
      Sources/CryptoSwift/BlockMode/CFB.swift
  13. 1 1
      Sources/CryptoSwift/BlockMode/CTR.swift
  14. 1 1
      Sources/CryptoSwift/BlockMode/ECB.swift
  15. 1 1
      Sources/CryptoSwift/BlockMode/OFB.swift
  16. 1 1
      Sources/CryptoSwift/BlockMode/PCBC.swift
  17. 1 1
      Sources/CryptoSwift/BlockMode/RandomAccessBlockModeWorker.swift
  18. 1 1
      Sources/CryptoSwift/Blowfish.swift
  19. 1 1
      Sources/CryptoSwift/CSArrayType+Extensions.swift
  20. 1 1
      Sources/CryptoSwift/ChaCha20.swift
  21. 1 1
      Sources/CryptoSwift/Checksum.swift
  22. 1 1
      Sources/CryptoSwift/Cipher.swift
  23. 1 1
      Sources/CryptoSwift/Collection+Extension.swift
  24. 1 1
      Sources/CryptoSwift/Cryptors.swift
  25. 1 1
      Sources/CryptoSwift/Digest.swift
  26. 1 1
      Sources/CryptoSwift/DigestType.swift
  27. 2 2
      Sources/CryptoSwift/Foundation/AES+Foundation.swift
  28. 2 2
      Sources/CryptoSwift/Foundation/Blowfish+Foundation.swift
  29. 1 1
      Sources/CryptoSwift/Foundation/CSArrayType+Foundation.swift
  30. 1 1
      Sources/CryptoSwift/Foundation/ChaCha20+Foundation.swift
  31. 1 1
      Sources/CryptoSwift/Foundation/Data+Extension.swift
  32. 1 1
      Sources/CryptoSwift/Foundation/HMAC+Foundation.swift
  33. 1 1
      Sources/CryptoSwift/Foundation/Rabbit+Foundation.swift
  34. 1 1
      Sources/CryptoSwift/Foundation/String+FoundationExtension.swift
  35. 1 1
      Sources/CryptoSwift/Foundation/Utils+Foundation.swift
  36. 1 1
      Sources/CryptoSwift/Generics.swift
  37. 1 1
      Sources/CryptoSwift/HMAC.swift
  38. 1 1
      Sources/CryptoSwift/Int+Extension.swift
  39. 1 1
      Sources/CryptoSwift/MD5.swift
  40. 1 1
      Sources/CryptoSwift/NoPadding.swift
  41. 1 1
      Sources/CryptoSwift/Operators.swift
  42. 1 1
      Sources/CryptoSwift/PKCS/PBKDF1.swift
  43. 1 1
      Sources/CryptoSwift/PKCS/PBKDF2.swift
  44. 2 2
      Sources/CryptoSwift/PKCS/PKCS5.swift
  45. 19 0
      Sources/CryptoSwift/PKCS/PKCS7.swift
  46. 3 3
      Sources/CryptoSwift/PKCS/PKCS7Padding.swift
  47. 1 1
      Sources/CryptoSwift/Padding.swift
  48. 1 1
      Sources/CryptoSwift/Poly1305.swift
  49. 1 1
      Sources/CryptoSwift/Rabbit.swift
  50. 1 1
      Sources/CryptoSwift/RandomAccessCryptor.swift
  51. 1 1
      Sources/CryptoSwift/RandomBytesSequence.swift
  52. 1 1
      Sources/CryptoSwift/SHA1.swift
  53. 1 1
      Sources/CryptoSwift/SHA2.swift
  54. 1 1
      Sources/CryptoSwift/SHA3.swift
  55. 1 1
      Sources/CryptoSwift/SecureBytes.swift
  56. 1 1
      Sources/CryptoSwift/String+Extension.swift
  57. 1 1
      Sources/CryptoSwift/UInt16+Extension.swift
  58. 1 1
      Sources/CryptoSwift/UInt32+Extension.swift
  59. 1 1
      Sources/CryptoSwift/UInt64+Extension.swift
  60. 1 1
      Sources/CryptoSwift/UInt8+Extension.swift
  61. 1 1
      Sources/CryptoSwift/Updatable.swift
  62. 1 1
      Sources/CryptoSwift/Utils.swift
  63. 1 1
      Sources/CryptoSwift/ZeroPadding.swift
  64. 9 9
      Tests/CryptoSwiftTests/AESTests.swift
  65. 2 2
      Tests/CryptoSwiftTests/Access.swift
  66. 1 1
      Tests/CryptoSwiftTests/BlowfishTests.swift
  67. 6 6
      Tests/CryptoSwiftTests/PaddingTests.swift

+ 11 - 7
CryptoSwift.xcodeproj/project.pbxproj

@@ -8,6 +8,7 @@
 
 /* Begin PBXBuildFile section */
 		674A736F1BF5D85B00866C5B /* RabbitTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 674A736E1BF5D85B00866C5B /* RabbitTests.swift */; };
+		750509991F6BEF2A00394A1B /* PKCS7.swift in Sources */ = {isa = PBXBuildFile; fileRef = 750509981F6BEF2A00394A1B /* PKCS7.swift */; };
 		750CC3EB1DC0CACE0096BE6E /* BlowfishTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 750CC3EA1DC0CACE0096BE6E /* BlowfishTests.swift */; };
 		75100F8F19B0BC890005C5F5 /* Poly1305Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75100F8E19B0BC890005C5F5 /* Poly1305Tests.swift */; };
 		753B33011DAB84D600D06422 /* RandomBytesSequenceTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 753B33001DAB84D600D06422 /* RandomBytesSequenceTests.swift */; };
@@ -66,7 +67,7 @@
 		75EC52A61EE8B8390048EB3B /* PBKDF1.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75EC52661EE8B6CA0048EB3B /* PBKDF1.swift */; };
 		75EC52A71EE8B8390048EB3B /* PBKDF2.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75EC52671EE8B6CA0048EB3B /* PBKDF2.swift */; };
 		75EC52A81EE8B8390048EB3B /* PKCS5.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75EC52681EE8B6CA0048EB3B /* PKCS5.swift */; };
-		75EC52A91EE8B83D0048EB3B /* PKCS7.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75EC52691EE8B6CA0048EB3B /* PKCS7.swift */; };
+		75EC52A91EE8B83D0048EB3B /* PKCS7Padding.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75EC52691EE8B6CA0048EB3B /* PKCS7Padding.swift */; };
 		75EC52AA1EE8B83D0048EB3B /* Poly1305.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75EC526A1EE8B6CA0048EB3B /* Poly1305.swift */; };
 		75EC52AB1EE8B83D0048EB3B /* Rabbit.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75EC526B1EE8B6CA0048EB3B /* Rabbit.swift */; };
 		75EC52AC1EE8B83D0048EB3B /* RandomAccessCryptor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75EC526C1EE8B6CA0048EB3B /* RandomAccessCryptor.swift */; };
@@ -152,6 +153,7 @@
 
 /* Begin PBXFileReference section */
 		674A736E1BF5D85B00866C5B /* RabbitTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RabbitTests.swift; sourceTree = "<group>"; };
+		750509981F6BEF2A00394A1B /* PKCS7.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PKCS7.swift; sourceTree = "<group>"; };
 		750CC3EA1DC0CACE0096BE6E /* BlowfishTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BlowfishTests.swift; sourceTree = "<group>"; };
 		75100F8E19B0BC890005C5F5 /* Poly1305Tests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Poly1305Tests.swift; sourceTree = "<group>"; };
 		753B33001DAB84D600D06422 /* RandomBytesSequenceTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RandomBytesSequenceTests.swift; sourceTree = "<group>"; };
@@ -212,7 +214,7 @@
 		75EC52661EE8B6CA0048EB3B /* PBKDF1.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PBKDF1.swift; sourceTree = "<group>"; };
 		75EC52671EE8B6CA0048EB3B /* PBKDF2.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PBKDF2.swift; sourceTree = "<group>"; };
 		75EC52681EE8B6CA0048EB3B /* PKCS5.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PKCS5.swift; sourceTree = "<group>"; };
-		75EC52691EE8B6CA0048EB3B /* PKCS7.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PKCS7.swift; sourceTree = "<group>"; };
+		75EC52691EE8B6CA0048EB3B /* PKCS7Padding.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PKCS7Padding.swift; sourceTree = "<group>"; };
 		75EC526A1EE8B6CA0048EB3B /* Poly1305.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Poly1305.swift; sourceTree = "<group>"; };
 		75EC526B1EE8B6CA0048EB3B /* Rabbit.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Rabbit.swift; sourceTree = "<group>"; };
 		75EC526C1EE8B6CA0048EB3B /* RandomAccessCryptor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RandomAccessCryptor.swift; sourceTree = "<group>"; };
@@ -348,8 +350,7 @@
 				75EC52621EE8B6CA0048EB3B /* NoPadding.swift */,
 				75EC52631EE8B6CA0048EB3B /* Operators.swift */,
 				75EC52641EE8B6CA0048EB3B /* Padding.swift */,
-				75EC52651EE8B6CA0048EB3B /* PKCS5 */,
-				75EC52691EE8B6CA0048EB3B /* PKCS7.swift */,
+				75EC52651EE8B6CA0048EB3B /* PKCS */,
 				75EC526A1EE8B6CA0048EB3B /* Poly1305.swift */,
 				75EC526B1EE8B6CA0048EB3B /* Rabbit.swift */,
 				75EC526C1EE8B6CA0048EB3B /* RandomAccessCryptor.swift */,
@@ -403,14 +404,16 @@
 			path = Foundation;
 			sourceTree = "<group>";
 		};
-		75EC52651EE8B6CA0048EB3B /* PKCS5 */ = {
+		75EC52651EE8B6CA0048EB3B /* PKCS */ = {
 			isa = PBXGroup;
 			children = (
+				75EC52691EE8B6CA0048EB3B /* PKCS7Padding.swift */,
 				75EC52661EE8B6CA0048EB3B /* PBKDF1.swift */,
 				75EC52671EE8B6CA0048EB3B /* PBKDF2.swift */,
 				75EC52681EE8B6CA0048EB3B /* PKCS5.swift */,
+				750509981F6BEF2A00394A1B /* PKCS7.swift */,
 			);
-			path = PKCS5;
+			path = PKCS;
 			sourceTree = "<group>";
 		};
 /* End PBXGroup section */
@@ -558,6 +561,7 @@
 				75EC52A41EE8B8290048EB3B /* Operators.swift in Sources */,
 				75EC529A1EE8B8200048EB3B /* HMAC+Foundation.swift in Sources */,
 				75EC52B21EE8B83D0048EB3B /* String+Extension.swift in Sources */,
+				750509991F6BEF2A00394A1B /* PKCS7.swift in Sources */,
 				75EC52B51EE8B83D0048EB3B /* UInt64+Extension.swift in Sources */,
 				75EC52AF1EE8B83D0048EB3B /* SHA1.swift in Sources */,
 				75EC52801EE8B8130048EB3B /* Bit.swift in Sources */,
@@ -565,7 +569,7 @@
 				75EC52871EE8B8170048EB3B /* CTR.swift in Sources */,
 				75EC52A21EE8B8290048EB3B /* MD5.swift in Sources */,
 				75EC527C1EE8B8130048EB3B /* AES.swift in Sources */,
-				75EC52A91EE8B83D0048EB3B /* PKCS7.swift in Sources */,
+				75EC52A91EE8B83D0048EB3B /* PKCS7Padding.swift in Sources */,
 				75EC52A51EE8B8290048EB3B /* Padding.swift in Sources */,
 				75EC527F1EE8B8130048EB3B /* BatchedCollection.swift in Sources */,
 				75EC52921EE8B81A0048EB3B /* CSArrayType+Extensions.swift in Sources */,

+ 3 - 3
Sources/CryptoSwift/AES.swift

@@ -2,7 +2,7 @@
 //  AES.swift
 //  CryptoSwift
 //
-//  Copyright (C) 2014-2017 Krzyżanowski <marcin@krzyzanowskim.com>
+//  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.
@@ -116,12 +116,12 @@ public final class AES: BlockCipher {
     /// - parameter key:       Key. Length of the key decides on AES variant.
     /// - parameter iv:        Initialization Vector (Optional for some blockMode values)
     /// - parameter blockMode: Cipher mode of operation
-    /// - parameter padding:   Padding method. PKCS7(), NoPadding(), ZeroPadding(), ...
+    /// - parameter padding:   Padding method. PKCS7.Padding(), NoPadding(), ZeroPadding(), ...
     ///
     /// - throws: AES.Error
     ///
     /// - returns: Instance
-    public init(key: Array<UInt8>, iv: Array<UInt8>? = nil, blockMode: BlockMode = .CBC, padding: Padding = PKCS7()) throws {
+    public init(key: Array<UInt8>, iv: Array<UInt8>? = nil, blockMode: BlockMode = .CBC, padding: Padding = PKCS7.Padding()) throws {
         self.key = Key(bytes: key)
         self.blockMode = blockMode
         self.padding = padding

+ 1 - 1
Sources/CryptoSwift/Array+Extension.swift

@@ -2,7 +2,7 @@
 //  ArrayExtension.swift
 //  CryptoSwift
 //
-//  Copyright (C) 2014-2017 Krzyżanowski <marcin@krzyzanowskim.com>
+//  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.

+ 1 - 1
Sources/CryptoSwift/Authenticator.swift

@@ -2,7 +2,7 @@
 //  MAC.swift
 //  CryptoSwift
 //
-//  Copyright (C) 2014-2017 Krzyżanowski <marcin@krzyzanowskim.com>
+//  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.

+ 1 - 1
Sources/CryptoSwift/BatchedCollection.swift

@@ -2,7 +2,7 @@
 //  BatchedCollection.swift
 //  CryptoSwift
 //
-//  Copyright (C) 2014-2017 Krzyżanowski <marcin@krzyzanowskim.com>
+//  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.

+ 1 - 1
Sources/CryptoSwift/Bit.swift

@@ -2,7 +2,7 @@
 //  Bit.swift
 //  CryptoSwift
 //
-//  Copyright (C) 2014-2017 Krzyżanowski <marcin@krzyzanowskim.com>
+//  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.

+ 1 - 1
Sources/CryptoSwift/BlockCipher.swift

@@ -2,7 +2,7 @@
 //  BlockCipher.swift
 //  CryptoSwift
 //
-//  Copyright (C) 2014-2017 Krzyżanowski <marcin@krzyzanowskim.com>
+//  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.

+ 1 - 1
Sources/CryptoSwift/BlockMode/BlockMode.swift

@@ -2,7 +2,7 @@
 //  BlockMode.swift
 //  CryptoSwift
 //
-//  Copyright (C) 2014-2017 Krzyżanowski <marcin@krzyzanowskim.com>
+//  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.

+ 1 - 1
Sources/CryptoSwift/BlockMode/BlockModeOptions.swift

@@ -2,7 +2,7 @@
 //  BlockModeOptions.swift
 //  CryptoSwift
 //
-//  Copyright (C) 2014-2017 Krzyżanowski <marcin@krzyzanowskim.com>
+//  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.

+ 1 - 1
Sources/CryptoSwift/BlockMode/BlockModeWorker.swift

@@ -2,7 +2,7 @@
 //  BlockModeWorker.swift
 //  CryptoSwift
 //
-//  Copyright (C) 2014-2017 Krzyżanowski <marcin@krzyzanowskim.com>
+//  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.

+ 1 - 1
Sources/CryptoSwift/BlockMode/CBC.swift

@@ -2,7 +2,7 @@
 //  CBC.swift
 //  CryptoSwift
 //
-//  Copyright (C) 2014-2017 Krzyżanowski <marcin@krzyzanowskim.com>
+//  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.

+ 1 - 1
Sources/CryptoSwift/BlockMode/CFB.swift

@@ -2,7 +2,7 @@
 //  CFB.swift
 //  CryptoSwift
 //
-//  Copyright (C) 2014-2017 Krzyżanowski <marcin@krzyzanowskim.com>
+//  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.

+ 1 - 1
Sources/CryptoSwift/BlockMode/CTR.swift

@@ -2,7 +2,7 @@
 //  CTR.swift
 //  CryptoSwift
 //
-//  Copyright (C) 2014-2017 Krzyżanowski <marcin@krzyzanowskim.com>
+//  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.

+ 1 - 1
Sources/CryptoSwift/BlockMode/ECB.swift

@@ -2,7 +2,7 @@
 //  BlockMode.swift
 //  CryptoSwift
 //
-//  Copyright (C) 2014-2017 Krzyżanowski <marcin@krzyzanowskim.com>
+//  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.

+ 1 - 1
Sources/CryptoSwift/BlockMode/OFB.swift

@@ -2,7 +2,7 @@
 //  OFB.swift
 //  CryptoSwift
 //
-//  Copyright (C) 2014-2017 Krzyżanowski <marcin@krzyzanowskim.com>
+//  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.

+ 1 - 1
Sources/CryptoSwift/BlockMode/PCBC.swift

@@ -2,7 +2,7 @@
 //  PCBM.swift
 //  CryptoSwift
 //
-//  Copyright (C) 2014-2017 Krzyżanowski <marcin@krzyzanowskim.com>
+//  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.

+ 1 - 1
Sources/CryptoSwift/BlockMode/RandomAccessBlockModeWorker.swift

@@ -2,7 +2,7 @@
 //  RandomAccessBlockModeWorker.swift
 //  CryptoSwift
 //
-//  Copyright (C) 2014-2017 Krzyżanowski <marcin@krzyzanowskim.com>
+//  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.

+ 1 - 1
Sources/CryptoSwift/Blowfish.swift

@@ -2,7 +2,7 @@
 //  Blowfish.swift
 //  CryptoSwift
 //
-//  Copyright (C) 2014-2017 Krzyżanowski <marcin@krzyzanowskim.com>
+//  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.

+ 1 - 1
Sources/CryptoSwift/CSArrayType+Extensions.swift

@@ -2,7 +2,7 @@
 //  _ArrayType+Extensions.swift
 //  CryptoSwift
 //
-//  Copyright (C) 2014-2017 Krzyżanowski <marcin@krzyzanowskim.com>
+//  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.

+ 1 - 1
Sources/CryptoSwift/ChaCha20.swift

@@ -2,7 +2,7 @@
 //  ChaCha20.swift
 //  CryptoSwift
 //
-//  Copyright (C) 2014-2017 Krzyżanowski <marcin@krzyzanowskim.com>
+//  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.

+ 1 - 1
Sources/CryptoSwift/Checksum.swift

@@ -2,7 +2,7 @@
 //  Checksum.swift
 //  CryptoSwift
 //
-//  Copyright (C) 2014-2017 Krzyżanowski <marcin@krzyzanowskim.com>
+//  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.

+ 1 - 1
Sources/CryptoSwift/Cipher.swift

@@ -2,7 +2,7 @@
 //  Cipher.swift
 //  CryptoSwift
 //
-//  Copyright (C) 2014-2017 Krzyżanowski <marcin@krzyzanowskim.com>
+//  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.

+ 1 - 1
Sources/CryptoSwift/Collection+Extension.swift

@@ -2,7 +2,7 @@
 //  Collection+Extension.swift
 //  CryptoSwift
 //
-//  Copyright (C) 2014-2017 Krzyżanowski <marcin@krzyzanowskim.com>
+//  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.

+ 1 - 1
Sources/CryptoSwift/Cryptors.swift

@@ -2,7 +2,7 @@
 //  Cryptors.swift
 //  CryptoSwift
 //
-//  Copyright (C) 2014-2017 Krzyżanowski <marcin@krzyzanowskim.com>
+//  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.

+ 1 - 1
Sources/CryptoSwift/Digest.swift

@@ -2,7 +2,7 @@
 //  Hash.swift
 //  CryptoSwift
 //
-//  Copyright (C) 2014-2017 Krzyżanowski <marcin@krzyzanowskim.com>
+//  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.

+ 1 - 1
Sources/CryptoSwift/DigestType.swift

@@ -2,7 +2,7 @@
 //  Digest.swift
 //  CryptoSwift
 //
-//  Copyright (C) 2014-2017 Krzyżanowski <marcin@krzyzanowskim.com>
+//  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.

+ 2 - 2
Sources/CryptoSwift/Foundation/AES+Foundation.swift

@@ -2,7 +2,7 @@
 //  AES+Foundation.swift
 //  CryptoSwift
 //
-//  Copyright (C) 2014-2017 Krzyżanowski <marcin@krzyzanowskim.com>
+//  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.
@@ -18,7 +18,7 @@ import Foundation
 
 extension AES {
 
-    public convenience init(key: String, iv: String, blockMode: BlockMode = .CBC, padding: Padding = PKCS7()) throws {
+    public convenience init(key: String, iv: String, blockMode: BlockMode = .CBC, padding: Padding = PKCS7.Padding()) throws {
         guard let kkey = key.data(using: String.Encoding.utf8, allowLossyConversion: false)?.bytes, let iiv = iv.data(using: String.Encoding.utf8, allowLossyConversion: false)?.bytes else {
             throw Error.invalidKeyOrInitializationVector
         }

+ 2 - 2
Sources/CryptoSwift/Foundation/Blowfish+Foundation.swift

@@ -2,7 +2,7 @@
 //  Blowfish+Foundation.swift
 //  CryptoSwift
 //
-//  Copyright (C) 2014-2017 Krzyżanowski <marcin@krzyzanowskim.com>
+//  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.
@@ -18,7 +18,7 @@ import Foundation
 
 extension Blowfish {
 
-    public convenience init(key: String, iv: String, blockMode: BlockMode = .CBC, padding: Padding = PKCS7()) throws {
+    public convenience init(key: String, iv: String, blockMode: BlockMode = .CBC, padding: Padding = PKCS7.Padding()) throws {
         guard let kkey = key.data(using: String.Encoding.utf8, allowLossyConversion: false)?.bytes, let iiv = iv.data(using: String.Encoding.utf8, allowLossyConversion: false)?.bytes else {
             throw Error.invalidKeyOrInitializationVector
         }

+ 1 - 1
Sources/CryptoSwift/Foundation/CSArrayType+Foundation.swift

@@ -2,7 +2,7 @@
 //  CSArrayType+Foundation.swift
 //  CryptoSwift
 //
-//  Copyright (C) 2014-2017 Krzyżanowski <marcin@krzyzanowskim.com>
+//  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.

+ 1 - 1
Sources/CryptoSwift/Foundation/ChaCha20+Foundation.swift

@@ -2,7 +2,7 @@
 //  ChaCha20+Foundation.swift
 //  CryptoSwift
 //
-//  Copyright (C) 2014-2017 Krzyżanowski <marcin@krzyzanowskim.com>
+//  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.

+ 1 - 1
Sources/CryptoSwift/Foundation/Data+Extension.swift

@@ -2,7 +2,7 @@
 //  PGPDataExtension.swift
 //  SwiftPGP
 //
-//  Copyright (C) 2014-2017 Krzyżanowski <marcin@krzyzanowskim.com>
+//  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.

+ 1 - 1
Sources/CryptoSwift/Foundation/HMAC+Foundation.swift

@@ -2,7 +2,7 @@
 //  HMAC+Foundation.swift
 //  CryptoSwift
 //
-//  Copyright (C) 2014-2017 Krzyżanowski <marcin@krzyzanowskim.com>
+//  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.

+ 1 - 1
Sources/CryptoSwift/Foundation/Rabbit+Foundation.swift

@@ -2,7 +2,7 @@
 //  Rabbit+Foundation.swift
 //  CryptoSwift
 //
-//  Copyright (C) 2014-2017 Krzyżanowski <marcin@krzyzanowskim.com>
+//  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.

+ 1 - 1
Sources/CryptoSwift/Foundation/String+FoundationExtension.swift

@@ -2,7 +2,7 @@
 //  String+Extension.swift
 //  CryptoSwift
 //
-//  Copyright (C) 2014-2017 Krzyżanowski <marcin@krzyzanowskim.com>
+//  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.

+ 1 - 1
Sources/CryptoSwift/Foundation/Utils+Foundation.swift

@@ -2,7 +2,7 @@
 //  Utils+Foundation.swift
 //  CryptoSwift
 //
-//  Copyright (C) 2014-2017 Krzyżanowski <marcin@krzyzanowskim.com>
+//  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.

+ 1 - 1
Sources/CryptoSwift/Generics.swift

@@ -2,7 +2,7 @@
 //  Generics.swift
 //  CryptoSwift
 //
-//  Copyright (C) 2014-2017 Krzyżanowski <marcin@krzyzanowskim.com>
+//  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.

+ 1 - 1
Sources/CryptoSwift/HMAC.swift

@@ -2,7 +2,7 @@
 //  HMAC.swift
 //  CryptoSwift
 //
-//  Copyright (C) 2014-2017 Krzyżanowski <marcin@krzyzanowskim.com>
+//  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.

+ 1 - 1
Sources/CryptoSwift/Int+Extension.swift

@@ -3,7 +3,7 @@
 //  CryptoSwift
 //
 //  Created by Marcin Krzyzanowski on 12/08/14.
-//  Copyright (C) 2014-2017 Krzyżanowski <marcin@krzyzanowskim.com>
+//  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.

+ 1 - 1
Sources/CryptoSwift/MD5.swift

@@ -2,7 +2,7 @@
 //  MD5.swift
 //  CryptoSwift
 //
-//  Copyright (C) 2014-2017 Krzyżanowski <marcin@krzyzanowskim.com>
+//  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.

+ 1 - 1
Sources/CryptoSwift/NoPadding.swift

@@ -2,7 +2,7 @@
 //  NoPadding.swift
 //  CryptoSwift
 //
-//  Copyright (C) 2014-2017 Krzyżanowski <marcin@krzyzanowskim.com>
+//  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.

+ 1 - 1
Sources/CryptoSwift/Operators.swift

@@ -2,7 +2,7 @@
 //  Operators.swift
 //  CryptoSwift
 //
-//  Copyright (C) 2014-2017 Krzyżanowski <marcin@krzyzanowskim.com>
+//  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.

+ 1 - 1
Sources/CryptoSwift/PKCS5/PBKDF1.swift → Sources/CryptoSwift/PKCS/PBKDF1.swift

@@ -2,7 +2,7 @@
 //  PBKDF1.swift
 //  CryptoSwift
 //
-//  Copyright (C) 2014-2017 Krzyżanowski <marcin@krzyzanowskim.com>
+//  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.

+ 1 - 1
Sources/CryptoSwift/PKCS5/PBKDF2.swift → Sources/CryptoSwift/PKCS/PBKDF2.swift

@@ -2,7 +2,7 @@
 //  PBKDF2.swift
 //  CryptoSwift
 //
-//  Copyright (C) 2014-2017 Krzyżanowski <marcin@krzyzanowskim.com>
+//  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.

+ 2 - 2
Sources/CryptoSwift/PKCS5/PKCS5.swift → Sources/CryptoSwift/PKCS/PKCS5.swift

@@ -2,7 +2,7 @@
 //  PKCS.swift
 //  CryptoSwift
 //
-//  Copyright (C) 2014-2017 Krzyżanowski <marcin@krzyzanowskim.com>
+//  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.
@@ -19,5 +19,5 @@
 //
 
 public enum PKCS5 {
-    //  PKCS#5 http://tools.ietf.org/html/rfc2898
+    typealias Padding = PKCS7Padding
 }

+ 19 - 0
Sources/CryptoSwift/PKCS/PKCS7.swift

@@ -0,0 +1,19 @@
+//
+//  PKCS7.swift
+//  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.
+//
+
+public enum PKCS7 {
+    typealias Padding = PKCS7Padding
+}

+ 3 - 3
Sources/CryptoSwift/PKCS7.swift → Sources/CryptoSwift/PKCS/PKCS7Padding.swift

@@ -1,8 +1,8 @@
 //
-//  PKCS7.swift
+//  PKCS7PAdding.swift
 //  CryptoSwift
 //
-//  Copyright (C) 2014-2017 Krzyżanowski <marcin@krzyzanowskim.com>
+//  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.
@@ -18,7 +18,7 @@
 //  and published by RSA Security Inc, starting in the early 1990s.
 //
 
-public struct PKCS7: Padding {
+public struct PKCS7Padding: Padding {
 
     public enum Error: Swift.Error {
         case invalidPaddingValue

+ 1 - 1
Sources/CryptoSwift/Padding.swift

@@ -2,7 +2,7 @@
 //  Padding.swift
 //  CryptoSwift
 //
-//  Copyright (C) 2014-2017 Krzyżanowski <marcin@krzyzanowskim.com>
+//  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.

+ 1 - 1
Sources/CryptoSwift/Poly1305.swift

@@ -2,7 +2,7 @@
 //  Poly1305.swift
 //  CryptoSwift
 //
-//  Copyright (C) 2014-2017 Krzyżanowski <marcin@krzyzanowskim.com>
+//  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.

+ 1 - 1
Sources/CryptoSwift/Rabbit.swift

@@ -2,7 +2,7 @@
 //  Rabbit.swift
 //  CryptoSwift
 //
-//  Copyright (C) 2014-2017 Krzyżanowski <marcin@krzyzanowskim.com>
+//  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.

+ 1 - 1
Sources/CryptoSwift/RandomAccessCryptor.swift

@@ -2,7 +2,7 @@
 //  RandomAccessCryptor.swift
 //  CryptoSwift
 //
-//  Copyright (C) 2014-2017 Krzyżanowski <marcin@krzyzanowskim.com>
+//  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.

+ 1 - 1
Sources/CryptoSwift/RandomBytesSequence.swift

@@ -2,7 +2,7 @@
 //  RandomBytesSequence.swift
 //  CryptoSwift
 //
-//  Copyright (C) 2014-2017 Krzyżanowski <marcin@krzyzanowskim.com>
+//  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.

+ 1 - 1
Sources/CryptoSwift/SHA1.swift

@@ -2,7 +2,7 @@
 //  SHA1.swift
 //  CryptoSwift
 //
-//  Copyright (C) 2014-2017 Krzyżanowski <marcin@krzyzanowskim.com>
+//  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.

+ 1 - 1
Sources/CryptoSwift/SHA2.swift

@@ -2,7 +2,7 @@
 //  SHA2.swift
 //  CryptoSwift
 //
-//  Copyright (C) 2014-2017 Krzyżanowski <marcin@krzyzanowskim.com>
+//  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.

+ 1 - 1
Sources/CryptoSwift/SHA3.swift

@@ -2,7 +2,7 @@
 //  SHA3.swift
 //  CryptoSwift
 //
-//  Copyright (C) 2014-2017 Krzyżanowski <marcin@krzyzanowskim.com>
+//  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.

+ 1 - 1
Sources/CryptoSwift/SecureBytes.swift

@@ -2,7 +2,7 @@
 //  SecureBytes.swift
 //  CryptoSwift
 //
-//  Copyright (C) 2014-2017 Krzyżanowski <marcin@krzyzanowskim.com>
+//  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.

+ 1 - 1
Sources/CryptoSwift/String+Extension.swift

@@ -2,7 +2,7 @@
 //  StringExtension.swift
 //  CryptoSwift
 //
-//  Copyright (C) 2014-2017 Krzyżanowski <marcin@krzyzanowskim.com>
+//  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.

+ 1 - 1
Sources/CryptoSwift/UInt16+Extension.swift

@@ -2,7 +2,7 @@
 //  UInt16+Extension.swift
 //  CryptoSwift
 //
-//  Copyright (C) 2014-2017 Krzyżanowski <marcin@krzyzanowskim.com>
+//  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.

+ 1 - 1
Sources/CryptoSwift/UInt32+Extension.swift

@@ -2,7 +2,7 @@
 //  UInt32Extension.swift
 //  CryptoSwift
 //
-//  Copyright (C) 2014-2017 Krzyżanowski <marcin@krzyzanowskim.com>
+//  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.

+ 1 - 1
Sources/CryptoSwift/UInt64+Extension.swift

@@ -2,7 +2,7 @@
 //  UInt64Extension.swift
 //  CryptoSwift
 //
-//  Copyright (C) 2014-2017 Krzyżanowski <marcin@krzyzanowskim.com>
+//  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.

+ 1 - 1
Sources/CryptoSwift/UInt8+Extension.swift

@@ -2,7 +2,7 @@
 //  ByteExtension.swift
 //  CryptoSwift
 //
-//  Copyright (C) 2014-2017 Krzyżanowski <marcin@krzyzanowskim.com>
+//  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.

+ 1 - 1
Sources/CryptoSwift/Updatable.swift

@@ -2,7 +2,7 @@
 //  Updatable.swift
 //  CryptoSwift
 //
-//  Copyright (C) 2014-2017 Krzyżanowski <marcin@krzyzanowskim.com>
+//  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.

+ 1 - 1
Sources/CryptoSwift/Utils.swift

@@ -2,7 +2,7 @@
 //  Utils.swift
 //  CryptoSwift
 //
-//  Copyright (C) 2014-2017 Krzyżanowski <marcin@krzyzanowskim.com>
+//  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.

+ 1 - 1
Sources/CryptoSwift/ZeroPadding.swift

@@ -2,7 +2,7 @@
 //  ZeroPadding.swift
 //  CryptoSwift
 //
-//  Copyright (C) 2014-2017 Krzyżanowski <marcin@krzyzanowskim.com>
+//  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.

+ 9 - 9
Tests/CryptoSwiftTests/AESTests.swift

@@ -70,7 +70,7 @@ final class AESTests: XCTestCase {
         let plaintext: Array<UInt8> = [0x6b, 0xc1, 0xbe, 0xe2, 0x2e, 0x40, 0x9f, 0x96, 0xe9, 0x3d, 0x7e, 0x11, 0x73, 0x93, 0x17, 0x2a]
         let expected: Array<UInt8> = [0x76, 0x49, 0xab, 0xac, 0x81, 0x19, 0xb2, 0x46, 0xce, 0xe9, 0x8e, 0x9b, 0x12, 0xe9, 0x19, 0x7d, 0x89, 0x64, 0xe0, 0xb1, 0x49, 0xc1, 0x0b, 0x7b, 0x68, 0x2e, 0x6e, 0x39, 0xaa, 0xeb, 0x73, 0x1c]
 
-        let aes = try! AES(key: key, iv: iv, blockMode: .CBC, padding: PKCS7())
+        let aes = try! AES(key: key, iv: iv, blockMode: .CBC, padding: PKCS7.Padding())
         let encrypted = try! aes.encrypt(plaintext)
         XCTAssertEqual(encrypted, expected, "encryption failed")
         let decrypted = try! aes.decrypt(encrypted)
@@ -82,7 +82,7 @@ final class AESTests: XCTestCase {
         let iv: Array<UInt8> = [0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f]
         let plaintext: Array<UInt8> = [0x6b, 0xc1, 0xbe, 0xe2, 0x2e, 0x40, 0x9f, 0x96, 0xe9, 0x3d, 0x7e, 0x11, 0x73, 0x93, 0x17, 0x2a, 0x6b, 0xc1, 0xbe, 0xe2, 0x2e, 0x40, 0x9f, 0x96, 0xe9, 0x3d, 0x7e, 0x11, 0x73, 0x93, 0x17, 0x2a]
 
-        let aes = try! AES(key: key, iv: iv, blockMode: .CBC, padding: PKCS7())
+        let aes = try! AES(key: key, iv: iv, blockMode: .CBC, padding: PKCS7.Padding())
 
         var ciphertext = Array<UInt8>()
         var encryptor = aes.makeEncryptor()
@@ -113,7 +113,7 @@ final class AESTests: XCTestCase {
         let iv: Array<UInt8> = [0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f]
         let ciphertext: Array<UInt8> = [118, 73, 171, 172, 129, 25, 178, 70, 206, 233, 142, 155, 18, 233, 25, 125, 76, 187, 200, 88, 117, 107, 53, 129, 37, 82, 158, 150, 152, 163, 143, 68, 169, 105, 137, 234, 93, 98, 239, 215, 41, 45, 51, 254, 138, 92, 251, 17]
 
-        let aes = try! AES(key: key, iv: iv, blockMode: .CBC, padding: PKCS7())
+        let aes = try! AES(key: key, iv: iv, blockMode: .CBC, padding: PKCS7.Padding())
         var plaintext = Array<UInt8>()
         var decryptor = aes.makeDecryptor()
         plaintext += try! decryptor.update(withBytes: ciphertext[0..<8])
@@ -299,8 +299,8 @@ final class AESTests: XCTestCase {
         let iv: Array<UInt8> = [0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f]
         let plaintext: Array<UInt8> = [49, 46, 50, 50, 50, 51, 51, 51, 51]
 
-        let aes = try! AES(key: key, iv: iv, blockMode: .CBC, padding: PKCS7())
-        let aes2 = try! AES(key: key2, iv: iv, blockMode: .CBC, padding: PKCS7())
+        let aes = try! AES(key: key, iv: iv, blockMode: .CBC, padding: PKCS7.Padding())
+        let aes2 = try! AES(key: key2, iv: iv, blockMode: .CBC, padding: PKCS7.Padding())
         let encrypted = try! aes.encrypt(plaintext)
         let decrypted = try? aes2.decrypt(encrypted)
         XCTAssertTrue(decrypted! != plaintext, "failed")
@@ -327,7 +327,7 @@ final class AESTests: XCTestCase {
         let plaintext = Array("Nullam quis risus eget urna mollis ornare vel eu leo.".utf8)
         let key = Array("passwordpassword".utf8).md5() // -md md5
         let iv = Array("drowssapdrowssap".utf8) // -iv 64726f777373617064726f7773736170
-        let aes = try! AES(key: key, iv: iv, blockMode: .CBC, padding: PKCS7()) // -aes-128-cbc
+        let aes = try! AES(key: key, iv: iv, blockMode: .CBC, padding: PKCS7.Padding()) // -aes-128-cbc
         let ciphertext = try! aes.encrypt(plaintext) // enc
 
         // $ echo -n "Nullam quis risus eget urna mollis ornare vel eu leo." | openssl enc -aes-128-cbc -md md5 -nosalt -iv 64726f777373617064726f7773736170 -pass pass:passwordpassword -base64
@@ -341,7 +341,7 @@ final class AESTests: XCTestCase {
         let ciphertext: Array<UInt8> = [0x2a, 0x3a, 0x80, 0x05, 0xaf, 0x46, 0x58, 0x2d, 0x66, 0x52, 0x10, 0xae, 0x86, 0xd3, 0x8e, 0x8f] // test
         let key = Array("passwordpassword".utf8).md5() // -md md5
         let iv = Array("drowssapdrowssap".utf8) // -iv 64726f777373617064726f7773736170
-        let aes = try! AES(key: key, iv: iv, blockMode: .CBC, padding: PKCS7()) // -aes-128-cbc
+        let aes = try! AES(key: key, iv: iv, blockMode: .CBC, padding: PKCS7.Padding()) // -aes-128-cbc
         let plaintext = try! ciphertext.decrypt(cipher: aes)
         XCTAssertEqual("74657374", plaintext.toHexString())
     }
@@ -355,7 +355,7 @@ final class AESTests: XCTestCase {
             let key: Array<UInt8> = [0x2b, 0x7e, 0x15, 0x16, 0x28, 0xae, 0xd2, 0xa6, 0xab, 0xf7, 0x15, 0x88, 0x09, 0xcf, 0x4f, 0x3c]
             let iv: Array<UInt8> = [0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f]
             let message = Array<UInt8>(repeating: 7, count: 1024 * 1024)
-            let aes = try! AES(key: key, iv: iv, blockMode: .CBC, padding: PKCS7())
+            let aes = try! AES(key: key, iv: iv, blockMode: .CBC, padding: PKCS7.Padding())
             measureMetrics([XCTPerformanceMetric.wallClockTime], automaticallyStartMeasuring: true, for: { () -> Void in
                 _ = try! aes.encrypt(message)
             })
@@ -365,7 +365,7 @@ final class AESTests: XCTestCase {
             let key: Array<UInt8> = [0x2b, 0x7e, 0x15, 0x16, 0x28, 0xae, 0xd2, 0xa6, 0xab, 0xf7, 0x15, 0x88, 0x09, 0xcf, 0x4f, 0x3c]
             let iv: Array<UInt8> = [0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f]
             let message = Array<UInt8>(repeating: 7, count: 1024 * 1024)
-            let aes = try! AES(key: key, iv: iv, blockMode: .CBC, padding: PKCS7())
+            let aes = try! AES(key: key, iv: iv, blockMode: .CBC, padding: PKCS7.Padding())
             measureMetrics([XCTPerformanceMetric.wallClockTime], automaticallyStartMeasuring: true, for: { () -> Void in
                 _ = try! aes.decrypt(message)
             })

+ 2 - 2
Tests/CryptoSwiftTests/Access.swift

@@ -145,8 +145,8 @@ class Access: XCTestCase {
 
     func testPadding() {
         // PKCS7
-        _ = PKCS7().add(to: [1, 2, 3], blockSize: 16)
-        _ = PKCS7().remove(from: [1, 2, 3], blockSize: 16)
+        _ = PKCS7.Padding().add(to: [1, 2, 3], blockSize: 16)
+        _ = PKCS7.Padding().remove(from: [1, 2, 3], blockSize: 16)
 
         // NoPadding
         _ = NoPadding().add(to: [1, 2, 3], blockSize: 16)

+ 1 - 1
Tests/CryptoSwiftTests/BlowfishTests.swift

@@ -179,7 +179,7 @@ class BlowfishTests: XCTestCase {
         let input = Array<UInt8>.init(hex: "37363534333231204E6F77206973207468652074696D6520666F722000")
 
         do {
-            let cipher = try Blowfish(key: key, iv: iv, blockMode: .CBC, padding: PKCS7())
+            let cipher = try Blowfish(key: key, iv: iv, blockMode: .CBC, padding: PKCS7.Padding())
             let ciphertext = try cipher.encrypt(input)
             let plaintext = try cipher.decrypt(ciphertext)
             XCTAssertEqual(plaintext, input)

+ 6 - 6
Tests/CryptoSwiftTests/PaddingTests.swift

@@ -13,27 +13,27 @@ final class PaddingTests: XCTestCase {
     func testPKCS7_0() {
         let input: Array<UInt8> = [1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6]
         let expected: Array<UInt8> = [1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16]
-        let padded = PKCS7().add(to: input, blockSize: 16)
+        let padded = PKCS7.Padding().add(to: input, blockSize: 16)
         XCTAssertEqual(padded, expected, "PKCS7 failed")
-        let clean = PKCS7().remove(from: padded, blockSize: nil)
+        let clean = PKCS7.Padding().remove(from: padded, blockSize: nil)
         XCTAssertEqual(clean, input, "PKCS7 failed")
     }
 
     func testPKCS7_1() {
         let input: Array<UInt8> = [1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5]
         let expected: Array<UInt8> = [1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 1]
-        let padded = PKCS7().add(to: input, blockSize: 16)
+        let padded = PKCS7.Padding().add(to: input, blockSize: 16)
         XCTAssertEqual(padded, expected, "PKCS7 failed")
-        let clean = PKCS7().remove(from: padded, blockSize: nil)
+        let clean = PKCS7.Padding().remove(from: padded, blockSize: nil)
         XCTAssertEqual(clean, input, "PKCS7 failed")
     }
 
     func testPKCS7_2() {
         let input: Array<UInt8> = [1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4]
         let expected: Array<UInt8> = [1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 2, 2]
-        let padded = PKCS7().add(to: input, blockSize: 16)
+        let padded = PKCS7.Padding().add(to: input, blockSize: 16)
         XCTAssertEqual(padded, expected, "PKCS7 failed")
-        let clean = PKCS7().remove(from: padded, blockSize: nil)
+        let clean = PKCS7.Padding().remove(from: padded, blockSize: nil)
         XCTAssertEqual(clean, input, "PKCS7 failed")
     }