 }
 
 public protocol DataSinkType /*: SinkType -- can I express this in Swift? */ {
-    mutating func put(data: [UInt8]) throws
+    mutating func put(data: UnsafeBufferPointer<UInt8>) throws
 }
 
 public final class DataSink: DataSinkType, CustomStringConvertible {
     public var array = [UInt8]()
-    public func put(data: [UInt8]) throws {
+    public func put(data: UnsafeBufferPointer<UInt8>) throws {
         self.array.extend(data)
     }
     public init() {}

            )
        )

        try updateWith(Array(output[0..<dataOutMoved])) // FIXME: Does this make a real copy?

        var HMAC = Array<UInt8>(count: HMACSize, repeatedValue: 0)
        CCHmacFinal(&self.HMACContext, &HMAC)

        try self.sink.put(HMAC)
    }
}


        header.extend([Version, UInt8(0)])  // FIXME: Refactor to support password option
        header.extend(iv)

        try self.updateWith(UnsafeBufferPointer(start: header, count:header.count))
    }

    private mutating func updateWith(data: UnsafeBufferPointer<UInt8>) throws {
        CCHmacUpdate(&self.HMACContext, data.baseAddress, data.count)
        try self.sink.put(data)
    }

    public mutating func put(data: UnsafeBufferPointer<UInt8>) throws {
        let outputLength = CCCryptorGetOutputLength(self.cryptor, data.count, false)
        var output = Array<UInt8>(count: outputLength, repeatedValue: 0)  // FIXME: Reuse buffer
        var dataOutMoved: Int = 0
        try checkResult(CCCryptorUpdate(
            self.cryptor,
            data.baseAddress, data.count,
            &output, outputLength,
            &dataOutMoved))

        try self.updateWith(UnsafeBufferPointer(start: output, count:dataOutMoved)) // FIXME: Does this make a real copy?
    }

    public mutating func put(data: [UInt8]) throws {
        try self.put(UnsafeBufferPointer(start: data, count: data.count))
    }

    public mutating func finish() throws {
