INNER CODE UNIT · Swift
Cryptor
Kitura/BlueCryptor · Sources/Cryptor/Cryptor.swift:27
public class Cryptor: StreamCryptor, Updatable {
/// Internal accumulator for gathering data from the update() and final() functions.
var accumulator: [UInt8] = []
///
/// Retrieves the encrypted or decrypted data.
///
///- Returns: the encrypted or decrypted data or nil if an error occured.
///
public func final() -> [UInt8]? {
let byteCount = Int(self.getOutputLength(inputByteCount: 0, isFinal: true))
var dataOut = Array<UInt8>(repeating: 0, count:byteCount)
var dataOutMoved = 0
(dataOutMoved, self.status) = final(byteArrayOut: &dataOut)
if self.status != .success {
return nil