ソースを参照

remove spaces from sides of range operator

per Marcin's comment
Evan Maloney 9 年 前
コミット
dfeaa795ae
1 ファイル変更5 行追加5 行削除
  1. 5 5
      Sources/CryptoSwift/Rabbit.swift

+ 5 - 5
Sources/CryptoSwift/Rabbit.swift

@@ -64,12 +64,12 @@ final public class Rabbit {
         
         
         // Key divided into 8 subkeys
         // Key divided into 8 subkeys
         var k = [UInt32](count: 8, repeatedValue: 0)
         var k = [UInt32](count: 8, repeatedValue: 0)
-        for j in 0 ..< 8 {
+        for j in 0..<8 {
             k[j] = UInt32(key[Rabbit.blockSize - (2*j + 1)]) | (UInt32(key[Rabbit.blockSize - (2*j + 2)]) << 8)
             k[j] = UInt32(key[Rabbit.blockSize - (2*j + 1)]) | (UInt32(key[Rabbit.blockSize - (2*j + 2)]) << 8)
         }
         }
         
         
         // Initialize state and counter variables from subkeys
         // Initialize state and counter variables from subkeys
-        for j in 0 ..< 8 {
+        for j in 0..<8 {
             if j % 2 == 0 {
             if j % 2 == 0 {
                 x[j] = (k[(j+1) % 8] << 16) | k[j]
                 x[j] = (k[(j+1) % 8] << 16) | k[j]
                 c[j] = (k[(j+4) % 8] << 16) | k[(j+5) % 8]
                 c[j] = (k[(j+4) % 8] << 16) | k[(j+5) % 8]
@@ -86,7 +86,7 @@ final public class Rabbit {
         nextState()
         nextState()
         
         
         // Reinitialize counter variables
         // Reinitialize counter variables
-        for j in 0 ..< 8 {
+        for j in 0..<8 {
             c[j] = c[j] ^ x[(j+4) % 8]
             c[j] = c[j] ^ x[(j+4) % 8]
         }
         }
         
         
@@ -123,7 +123,7 @@ final public class Rabbit {
     private func nextState() {
     private func nextState() {
         // Before an iteration the counters are incremented
         // Before an iteration the counters are incremented
         var carry = p7
         var carry = p7
-        for j in 0 ..< 8 {
+        for j in 0..<8 {
             let prev = c[j]
             let prev = c[j]
             c[j] = prev &+ a[j] &+ carry
             c[j] = prev &+ a[j] &+ carry
             carry = prev > c[j] ? 1 : 0 // detect overflow
             carry = prev > c[j] ? 1 : 0 // detect overflow
@@ -163,7 +163,7 @@ final public class Rabbit {
         output16[0] = UInt16(truncatingBitPattern: x[6] >> 16) ^ UInt16(truncatingBitPattern: x[1])
         output16[0] = UInt16(truncatingBitPattern: x[6] >> 16) ^ UInt16(truncatingBitPattern: x[1])
         
         
         var output8 = [UInt8](count: Rabbit.blockSize, repeatedValue: 0)
         var output8 = [UInt8](count: Rabbit.blockSize, repeatedValue: 0)
-        for j in 0 ..< output16.count {
+        for j in 0..<output16.count {
             output8[j * 2] = UInt8(truncatingBitPattern: output16[j] >> 8)
             output8[j * 2] = UInt8(truncatingBitPattern: output16[j] >> 8)
             output8[j * 2 + 1] = UInt8(truncatingBitPattern: output16[j])
             output8[j * 2 + 1] = UInt8(truncatingBitPattern: output16[j])
         }
         }