         ///
         /// - returns: Trailing data
         public func finalData() -> Data {
-            var result = NSData(data: handle(engine.finalData())) as Data
+            var result = handle(engine.finalData())
             result.append(hmac.finalData())
             return result
         }


        private func handle(_ data: Data) -> Data {
            var result: Data
            if let ph = pendingHeader {
                var accum = NSData(data: ph) as Data
                pendingHeader = nil
                accum.append(data)
                result = accum

        return try Decryptor(password: password).decryptData(data)
    }

    /// Generates random Data of given length
    /// Crashes if `length` is larger than allocatable memory, or if the system random number generator is not available.
    public static func randomData(ofLength length: Int) -> Data {
        var data = Data(count: length)!
