Selaa lähdekoodia

Adapt fileprivate from latest swift snapshot

Marcin Krzyżanowski 9 vuotta sitten
vanhempi
commit
4c3a02d4da

+ 1 - 1
.swift-version

@@ -1 +1 @@
-DEVELOPMENT-SNAPSHOT-2016-07-28-a
+DEVELOPMENT-SNAPSHOT-2016-07-29-a

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 9 - 9
Sources/CryptoSwift/AES.swift


+ 1 - 1
Sources/CryptoSwift/ChaCha20.swift

@@ -94,7 +94,7 @@ final public class ChaCha20: BlockCipher {
         return output;
     }
     
-    private final func encryptBytes(_ message:Array<UInt8>) throws -> Array<UInt8> {
+    fileprivate final func encryptBytes(_ message:Array<UInt8>) throws -> Array<UInt8> {
         var ctx = context
         var c = Array<UInt8>(repeating: 0, count: message.count)
         

+ 2 - 2
Sources/CryptoSwift/IntExtension.swift

@@ -51,12 +51,12 @@ extension Int {
 extension Int {
     
     /** Shift bits to the left. All bits are shifted (including sign bit) */
-    private mutating func shiftLeft(by count: Int) {
+    fileprivate mutating func shiftLeft(by count: Int) {
         self = CryptoSwift.shiftLeft(self, by: count) //FIXME: count:
     }
     
     /** Shift bits to the right. All bits are shifted (including sign bit) */
-    private mutating func shiftRight(by count: Int) {
+    fileprivate mutating func shiftRight(by count: Int) {
         if (self == 0) {
             return
         }

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

@@ -32,7 +32,7 @@ public extension PKCS5 {
                 }
             }
 
-            private func calculateHash(_ bytes:Array<UInt8>) -> Array<UInt8>? {
+            fileprivate func calculateHash(_ bytes:Array<UInt8>) -> Array<UInt8>? {
                 switch (self) {
                 case .sha1:
                     return Hash.sha1(bytes).calculate()

+ 5 - 5
Sources/CryptoSwift/PKCS5/PBKDF2.swift

@@ -25,10 +25,10 @@ public extension PKCS5 {
         }
 
         private let salt: Array<UInt8>   // S
-        private let iterations: Int // c
+        fileprivate let iterations: Int // c
         private let numBlocks: UInt // l
         private let dkLen: Int;
-        private let prf: HMAC
+        fileprivate let prf: HMAC
 
         /// - parameters:
         ///   - salt: salt
@@ -69,8 +69,8 @@ public extension PKCS5 {
     }
 }
 
-private extension PKCS5.PBKDF2 {
-    private func INT(_ i: UInt) -> Array<UInt8> {
+fileprivate extension PKCS5.PBKDF2 {
+    func INT(_ i: UInt) -> Array<UInt8> {
         var inti = Array<UInt8>(repeating: 0, count: 4)
         inti[0] = UInt8((i >> 24) & 0xFF)
         inti[1] = UInt8((i >> 16) & 0xFF)
@@ -81,7 +81,7 @@ private extension PKCS5.PBKDF2 {
 
     // F (P, S, c, i) = U_1 \xor U_2 \xor ... \xor U_c
     // U_1 = PRF (P, S || INT (i))
-    private func calculateBlock(_ salt: Array<UInt8>, blockNum: UInt) -> Array<UInt8>? {
+    func calculateBlock(_ salt: Array<UInt8>, blockNum: UInt) -> Array<UInt8>? {
         guard let u1 = prf.authenticate(salt + INT(blockNum)) else {
             return nil
         }

+ 2 - 2
Sources/CryptoSwift/Rabbit.swift

@@ -61,7 +61,7 @@ final public class Rabbit: BlockCipher {
     }
     
     // MARK: -
-    private func setup() {
+    fileprivate func setup() {
         p7 = 0
         
         // Key divided into 8 subkeys
@@ -151,7 +151,7 @@ final public class Rabbit: BlockCipher {
         return UInt32(truncatingBitPattern: square ^ (square >> 32))
     }
     
-    private func nextOutput() -> Array<UInt8> {
+    fileprivate func nextOutput() -> Array<UInt8> {
         nextState()
         
         var output16 = [UInt16](repeating: 0, count: Rabbit.blockSize / 2)

+ 3 - 3
Sources/CryptoSwift/SHA2.swift

@@ -55,7 +55,7 @@ final class SHA2 : HashProtocol {
         
         var size:Int { return self.rawValue }
         
-        private var h:Array<UInt64> {
+        fileprivate var h:Array<UInt64> {
             switch (self) {
             case .sha224:
                 return [0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939, 0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4]
@@ -68,7 +68,7 @@ final class SHA2 : HashProtocol {
             }
         }
         
-        private var k:Array<UInt64> {
+        fileprivate var k:Array<UInt64> {
             switch (self) {
             case .sha224, .sha256:
                 return [0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,
@@ -99,7 +99,7 @@ final class SHA2 : HashProtocol {
             }
         }
         
-        private func resultingArray<T>(_ hh:[T]) -> ArraySlice<T> {
+        fileprivate func resultingArray<T>(_ hh:[T]) -> ArraySlice<T> {
             switch (self) {
             case .sha224:
                 return hh[0..<7]

+ 2 - 2
Sources/CryptoSwift/UInt32Extension.swift

@@ -36,7 +36,7 @@ extension UInt32 {
 extension UInt32 {
     
     /** Shift bits to the left. All bits are shifted (including sign bit) */
-    private mutating func shiftLeft(by count: UInt32) {
+    fileprivate mutating func shiftLeft(by count: UInt32) {
         if (self == 0) {
             return
         }
@@ -62,7 +62,7 @@ extension UInt32 {
     }
     
     /** Shift bits to the right. All bits are shifted (including sign bit) */
-    private mutating func shiftRight(by count: UInt32) {
+    fileprivate mutating func shiftRight(by count: UInt32) {
         if (self == 0) {
             return
         }

Kaikkia tiedostoja ei voida näyttää, sillä liian monta tiedostoa muuttui tässä diffissä