From 5e4e451fc4be052cb0ccf87582b8ec8520b2a3d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20Krzyz=CC=87anowski?= Date: Tue, 26 Apr 2016 21:09:08 +0200 Subject: [PATCH] BlockCipherType -> BlockCipher --- CryptoSwift.xcodeproj/project.pbxproj | 20 +++++++++---------- Sources/CryptoSwift/AES.swift | 2 +- ...lockCipherType.swift => BlockCipher.swift} | 4 ++-- Sources/CryptoSwift/ChaCha20.swift | 2 +- Sources/CryptoSwift/Rabbit.swift | 2 +- 5 files changed, 15 insertions(+), 15 deletions(-) rename Sources/CryptoSwift/{BlockCipherType.swift => BlockCipher.swift} (76%) diff --git a/CryptoSwift.xcodeproj/project.pbxproj b/CryptoSwift.xcodeproj/project.pbxproj index 0b8864f..f6bfd7a 100644 --- a/CryptoSwift.xcodeproj/project.pbxproj +++ b/CryptoSwift.xcodeproj/project.pbxproj @@ -176,10 +176,10 @@ 757DA2551A4ED408002BA3EF /* AESTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 757DA2541A4ED408002BA3EF /* AESTests.swift */; }; 757DA2571A4ED47B002BA3EF /* Helpers.swift in Sources */ = {isa = PBXBuildFile; fileRef = 757DA2561A4ED47B002BA3EF /* Helpers.swift */; }; 757DA2591A4ED4D7002BA3EF /* ChaCha20Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 757DA2581A4ED4D7002BA3EF /* ChaCha20Tests.swift */; }; - 757F44091CC172B6002B1F85 /* BlockCipherType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 757F44081CC172B6002B1F85 /* BlockCipherType.swift */; }; - 757F440A1CC172B6002B1F85 /* BlockCipherType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 757F44081CC172B6002B1F85 /* BlockCipherType.swift */; }; - 757F440B1CC172B6002B1F85 /* BlockCipherType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 757F44081CC172B6002B1F85 /* BlockCipherType.swift */; }; - 757F440C1CC172B6002B1F85 /* BlockCipherType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 757F44081CC172B6002B1F85 /* BlockCipherType.swift */; }; + 757F44091CC172B6002B1F85 /* BlockCipher.swift in Sources */ = {isa = PBXBuildFile; fileRef = 757F44081CC172B6002B1F85 /* BlockCipher.swift */; }; + 757F440A1CC172B6002B1F85 /* BlockCipher.swift in Sources */ = {isa = PBXBuildFile; fileRef = 757F44081CC172B6002B1F85 /* BlockCipher.swift */; }; + 757F440B1CC172B6002B1F85 /* BlockCipher.swift in Sources */ = {isa = PBXBuildFile; fileRef = 757F44081CC172B6002B1F85 /* BlockCipher.swift */; }; + 757F440C1CC172B6002B1F85 /* BlockCipher.swift in Sources */ = {isa = PBXBuildFile; fileRef = 757F44081CC172B6002B1F85 /* BlockCipher.swift */; }; 757F440E1CC1822B002B1F85 /* SecureBytes.swift in Sources */ = {isa = PBXBuildFile; fileRef = 757F440D1CC1822A002B1F85 /* SecureBytes.swift */; }; 757F440F1CC1822B002B1F85 /* SecureBytes.swift in Sources */ = {isa = PBXBuildFile; fileRef = 757F440D1CC1822A002B1F85 /* SecureBytes.swift */; }; 757F44101CC1822B002B1F85 /* SecureBytes.swift in Sources */ = {isa = PBXBuildFile; fileRef = 757F440D1CC1822A002B1F85 /* SecureBytes.swift */; }; @@ -367,7 +367,7 @@ 757DA2541A4ED408002BA3EF /* AESTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AESTests.swift; sourceTree = ""; }; 757DA2561A4ED47B002BA3EF /* Helpers.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Helpers.swift; sourceTree = ""; }; 757DA2581A4ED4D7002BA3EF /* ChaCha20Tests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ChaCha20Tests.swift; sourceTree = ""; }; - 757F44081CC172B6002B1F85 /* BlockCipherType.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = BlockCipherType.swift; path = Sources/CryptoSwift/BlockCipherType.swift; sourceTree = SOURCE_ROOT; }; + 757F44081CC172B6002B1F85 /* BlockCipher.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = BlockCipher.swift; path = Sources/CryptoSwift/BlockCipher.swift; sourceTree = SOURCE_ROOT; }; 757F440D1CC1822A002B1F85 /* SecureBytes.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = SecureBytes.swift; path = Sources/CryptoSwift/SecureBytes.swift; sourceTree = SOURCE_ROOT; }; 7588034B1C8F8C33008C1576 /* BlockModeGenerator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = BlockModeGenerator.swift; path = Sources/CryptoSwift/BlockMode/BlockModeGenerator.swift; sourceTree = SOURCE_ROOT; }; 758A94271A65C59200E46135 /* HMACTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HMACTests.swift; sourceTree = ""; }; @@ -473,7 +473,7 @@ 757BC91F1C1CA5790093AAA9 /* BytesSequence.swift */, 757BC9201C1CA5790093AAA9 /* ChaCha20.swift */, 757BC9211C1CA5790093AAA9 /* CipherProtocol.swift */, - 757F44081CC172B6002B1F85 /* BlockCipherType.swift */, + 757F44081CC172B6002B1F85 /* BlockCipher.swift */, 75CB93291C8F5EC60087740D /* BlockMode */, 757BC9231C1CA5790093AAA9 /* CRC.swift */, 757BC9251C1CA5790093AAA9 /* CSArrayType+Extensions.swift */, @@ -810,7 +810,7 @@ 757BC9851C1CA5790093AAA9 /* IntExtension.swift in Sources */, 757BC9B11C1CA5790093AAA9 /* String+Extension.swift in Sources */, 757BC96D1C1CA5790093AAA9 /* Generics.swift in Sources */, - 757F440A1CC172B6002B1F85 /* BlockCipherType.swift in Sources */, + 757F440A1CC172B6002B1F85 /* BlockCipher.swift in Sources */, 75CB93261C8F5EC10087740D /* CBC.swift in Sources */, 757BC9711C1CA5790093AAA9 /* Hash.swift in Sources */, 75CB93361C8F5FCE0087740D /* PCBC.swift in Sources */, @@ -868,7 +868,7 @@ 757BC9841C1CA5790093AAA9 /* IntExtension.swift in Sources */, 757BC9B01C1CA5790093AAA9 /* String+Extension.swift in Sources */, 757BC96C1C1CA5790093AAA9 /* Generics.swift in Sources */, - 757F44091CC172B6002B1F85 /* BlockCipherType.swift in Sources */, + 757F44091CC172B6002B1F85 /* BlockCipher.swift in Sources */, 75CB93251C8F5EC10087740D /* CBC.swift in Sources */, 757BC9701C1CA5790093AAA9 /* Hash.swift in Sources */, 75CB93351C8F5FCE0087740D /* PCBC.swift in Sources */, @@ -943,7 +943,7 @@ 757BC9861C1CA5790093AAA9 /* IntExtension.swift in Sources */, 757BC9B21C1CA5790093AAA9 /* String+Extension.swift in Sources */, 757BC96E1C1CA5790093AAA9 /* Generics.swift in Sources */, - 757F440C1CC172B6002B1F85 /* BlockCipherType.swift in Sources */, + 757F440C1CC172B6002B1F85 /* BlockCipher.swift in Sources */, 75CB93271C8F5EC10087740D /* CBC.swift in Sources */, 757BC9721C1CA5790093AAA9 /* Hash.swift in Sources */, 75CB93371C8F5FCE0087740D /* PCBC.swift in Sources */, @@ -1001,7 +1001,7 @@ 757BC9871C1CA5790093AAA9 /* IntExtension.swift in Sources */, 757BC9B31C1CA5790093AAA9 /* String+Extension.swift in Sources */, 757BC96F1C1CA5790093AAA9 /* Generics.swift in Sources */, - 757F440B1CC172B6002B1F85 /* BlockCipherType.swift in Sources */, + 757F440B1CC172B6002B1F85 /* BlockCipher.swift in Sources */, 75CB93281C8F5EC10087740D /* CBC.swift in Sources */, 757BC9731C1CA5790093AAA9 /* Hash.swift in Sources */, 75CB93381C8F5FCE0087740D /* PCBC.swift in Sources */, diff --git a/Sources/CryptoSwift/AES.swift b/Sources/CryptoSwift/AES.swift index f14358e..bc56b0d 100644 --- a/Sources/CryptoSwift/AES.swift +++ b/Sources/CryptoSwift/AES.swift @@ -10,7 +10,7 @@ private typealias Key = SecureBytes -final public class AES: BlockCipherType { +final public class AES: BlockCipher { public enum Error: ErrorType { case BlockSizeExceeded case InvalidKeyOrInitializationVector diff --git a/Sources/CryptoSwift/BlockCipherType.swift b/Sources/CryptoSwift/BlockCipher.swift similarity index 76% rename from Sources/CryptoSwift/BlockCipherType.swift rename to Sources/CryptoSwift/BlockCipher.swift index 1627ecc..4f50608 100644 --- a/Sources/CryptoSwift/BlockCipherType.swift +++ b/Sources/CryptoSwift/BlockCipher.swift @@ -1,11 +1,11 @@ // -// BlockCipherType.swift +// BlockCipher.swift // CryptoSwift // // Created by Marcin Krzyzanowski on 15/04/16. // Copyright © 2016 Marcin Krzyzanowski. All rights reserved. // -protocol BlockCipherType { +protocol BlockCipher { static var blockSize: Int { get } } \ No newline at end of file diff --git a/Sources/CryptoSwift/ChaCha20.swift b/Sources/CryptoSwift/ChaCha20.swift index 21cefbd..d2f7386 100644 --- a/Sources/CryptoSwift/ChaCha20.swift +++ b/Sources/CryptoSwift/ChaCha20.swift @@ -6,7 +6,7 @@ // Copyright (c) 2014 Marcin Krzyzanowski. All rights reserved. // -final public class ChaCha20: BlockCipherType { +final public class ChaCha20: BlockCipher { public enum Error: ErrorType { case MissingContext diff --git a/Sources/CryptoSwift/Rabbit.swift b/Sources/CryptoSwift/Rabbit.swift index 4a67097..fdf6de6 100644 --- a/Sources/CryptoSwift/Rabbit.swift +++ b/Sources/CryptoSwift/Rabbit.swift @@ -8,7 +8,7 @@ private typealias Key = SecureBytes -final public class Rabbit: BlockCipherType { +final public class Rabbit: BlockCipher { /// Size of IV in bytes public static let ivSize = 64 / 8