Skip to content

Commit c02d262

Browse files
committed
ChaCha20 and Rabbit is not UpdatableCryptor compatible (yet)
1 parent 9005453 commit c02d262

File tree

2 files changed

+0
-82
lines changed

2 files changed

+0
-82
lines changed

Sources/CryptoSwift/ChaCha20.swift

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -162,47 +162,6 @@ final public class ChaCha20: BlockCipher {
162162
}
163163
}
164164

165-
extension ChaCha20 {
166-
public struct Encryptor: Cryptor {
167-
let chacha20: ChaCha20
168-
169-
init(chacha20: ChaCha20) {
170-
self.chacha20 = chacha20
171-
}
172-
173-
public func update(withBytes bytes: [UInt8], isLast: Bool = false) throws -> [UInt8] {
174-
return try chacha20.encrypt(bytes)
175-
}
176-
}
177-
}
178-
179-
extension ChaCha20 {
180-
public struct Decryptor: Cryptor {
181-
let chacha20: ChaCha20
182-
183-
init(chacha20: ChaCha20) {
184-
self.chacha20 = chacha20
185-
}
186-
187-
public func update(withBytes bytes: [UInt8], isLast: Bool = false) throws -> [UInt8] {
188-
return try chacha20.decrypt(bytes)
189-
}
190-
}
191-
}
192-
193-
// MARK: - Cipher
194-
195-
extension ChaCha20: UpdatableCryptor {
196-
197-
public func makeEncryptor() -> ChaCha20.Encryptor {
198-
return Encryptor(chacha20: self)
199-
}
200-
201-
public func makeDecryptor() -> ChaCha20.Decryptor {
202-
return Decryptor(chacha20: self)
203-
}
204-
}
205-
206165
// MARK: Cipher
207166
extension ChaCha20: Cipher {
208167
public func encrypt(bytes:[UInt8]) throws -> [UInt8] {

Sources/CryptoSwift/Rabbit.swift

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -173,47 +173,6 @@ final public class Rabbit: BlockCipher {
173173
}
174174
}
175175

176-
extension Rabbit {
177-
public struct Encryptor: Cryptor {
178-
let rabbit: Rabbit
179-
180-
init(rabbit: Rabbit) {
181-
self.rabbit = rabbit
182-
}
183-
184-
public func update(withBytes bytes: [UInt8], isLast: Bool = false) throws -> [UInt8] {
185-
return rabbit.encrypt(bytes)
186-
}
187-
}
188-
}
189-
190-
extension Rabbit {
191-
public struct Decryptor: Cryptor {
192-
let rabbit: Rabbit
193-
194-
init(rabbit: Rabbit) {
195-
self.rabbit = rabbit
196-
}
197-
198-
public func update(withBytes bytes: [UInt8], isLast: Bool = false) throws -> [UInt8] {
199-
return rabbit.decrypt(bytes)
200-
}
201-
}
202-
}
203-
204-
205-
// MARK: UpdatableCryptor
206-
extension Rabbit: UpdatableCryptor {
207-
208-
public func makeEncryptor() -> Rabbit.Encryptor {
209-
return Encryptor(rabbit: self)
210-
}
211-
212-
public func makeDecryptor() -> Rabbit.Decryptor {
213-
return Decryptor(rabbit: self)
214-
}
215-
}
216-
217176
// MARK: Cipher
218177
extension Rabbit: Cipher {
219178
public func encrypt(bytes: [UInt8]) -> [UInt8] {

0 commit comments

Comments
 (0)