Jelajahi Sumber

Minors cosmetics

Marcin Krzyżanowski 10 tahun lalu
induk
melakukan
60d883043a
3 mengubah file dengan 4 tambahan dan 4 penghapusan
  1. 2 2
      CryptoSwift/Generics.swift
  2. 1 1
      CryptoSwift/HashProtocol.swift
  3. 1 1
      CryptoSwift/MD5.swift

+ 2 - 2
CryptoSwift/Generics.swift

@@ -79,13 +79,13 @@ func arrayOfBytes<T>(value:T, length:Int? = nil) -> [UInt8] {
 // MARK: - shiftLeft
 
 // helper to be able tomake shift operation on T
-func <<<T:SignedIntegerType>(lhs: T, rhs: Int) -> Int {
+func << <T:SignedIntegerType>(lhs: T, rhs: Int) -> Int {
     let a = lhs as! Int
     let b = rhs
     return a << b
 }
 
-func <<<T:UnsignedIntegerType>(lhs: T, rhs: Int) -> UInt {
+func << <T:UnsignedIntegerType>(lhs: T, rhs: Int) -> UInt {
     let a = lhs as! UInt
     let b = rhs
     return a << b

+ 1 - 1
CryptoSwift/HashProtocol.swift

@@ -8,7 +8,7 @@
 
 import Foundation
 
-protocol HashProtocol {
+internal protocol HashProtocol {
     var message: NSData { get }
 
     /** Common part for hash calculation. Prepare header data. */

+ 1 - 1
CryptoSwift/MD5.swift

@@ -60,7 +60,7 @@ final class MD5 : HashProtocol  {
             let chunk = tmpMessage.subdataWithRange(NSRange(location: i, length: min(chunkSizeBytes,leftMessageBytes)))
             
             // break chunk into sixteen 32-bit words M[j], 0 ≤ j ≤ 15
-            var M:[UInt32] = [UInt32](count: 16, repeatedValue: 0)
+            var M = [UInt32](count: 16, repeatedValue: 0)
             let range = NSRange(location:0, length: M.count * sizeof(UInt32))
             chunk.getBytes(UnsafeMutablePointer<Void>(M), range: range)