|
@@ -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)
|
|
|
}
|
|
|
}
|