Browse Source

Update Cipher compatibilty

Marcin Krzyżanowski 8 years ago
parent
commit
c5ba0458a7
1 changed files with 3 additions and 3 deletions
  1. 3 3
      Sources/CryptoSwift/Rabbit.swift

+ 3 - 3
Sources/CryptoSwift/Rabbit.swift

@@ -188,7 +188,7 @@ public final class Rabbit: BlockCipher {
 // MARK: Cipher
 extension Rabbit: Cipher {
 
-    public func encrypt<C: Collection>(_ bytes: C) -> Array<UInt8> where C.Element == UInt8, C.IndexDistance == Int, C.Index == Int {
+    public func encrypt(_ bytes: ArraySlice<UInt8>) throws -> Array<UInt8> {
         setup()
 
         var result = Array<UInt8>(repeating: 0, count: bytes.count)
@@ -209,7 +209,7 @@ extension Rabbit: Cipher {
         return result
     }
 
-    public func decrypt<C: Collection>(_ bytes: C) -> Array<UInt8> where C.Element == UInt8, C.IndexDistance == Int, C.Index == Int {
-        return encrypt(bytes)
+    public func decrypt(_ bytes: ArraySlice<UInt8>) throws -> Array<UInt8> {
+        return try encrypt(bytes)
     }
 }