Browse Source

Bit.zero -> Bit.Zero (beta6)

Marcin Krzyżanowski 11 years ago
parent
commit
735bbbf43e
2 changed files with 4 additions and 4 deletions
  1. 3 3
      CryptoSwift/ByteExtension.swift
  2. 1 1
      CryptoSwift/IntExtension.swift

+ 3 - 3
CryptoSwift/ByteExtension.swift

@@ -14,14 +14,14 @@ extension Byte {
     internal func bits() -> [Bit] {
         let totalBitsCount = sizeof(Byte) * 8
         
-        var bitsArray:[Bit] = [Bit](count: totalBitsCount, repeatedValue: Bit.zero)
+        var bitsArray:[Bit] = [Bit](count: totalBitsCount, repeatedValue: Bit.Zero)
         
         for j in 0..<totalBitsCount {
             let bitVal:Byte = 1 << UInt8(totalBitsCount - 1 - j)
             let check = self & bitVal
             
             if (check != 0) {
-                bitsArray[j] = Bit.one;
+                bitsArray[j] = Bit.One;
             }
         }
         return bitsArray
@@ -31,7 +31,7 @@ extension Byte {
         var s = String()
         let arr:[Bit] = self.bits()
         for (idx,b) in enumerate(arr) {
-            s += (b == Bit.one ? "1" : "0")
+            s += (b == Bit.One ? "1" : "0")
             if ((idx + 1) % 8 == 0) { s += " " }
         }
         return s

+ 1 - 1
CryptoSwift/IntExtension.swift

@@ -63,7 +63,7 @@ extension Int {
     private init(bits: [Bit]) {
         var bitPattern:UInt = 0
         for (idx,b) in enumerate(bits) {
-            if (b == Bit.one) {
+            if (b == Bit.Zero) {
                 var bit:UInt = UInt(1) << UInt(idx)
                 bitPattern = bitPattern | bit
             }