Seems the Standard Library designers of Swift think a few nested withUnsafeSomething should be acceptable.
A global function `withUnsafePointers(_:_:_:_:)` has been removed from Swift Standard Library, and the error message of using it says:
error: 'withUnsafePointers' is unavailable: use nested withUnsafePointer(to:_:) instead
As you may already know, you still can use `NSMutableData` or `NSData`, if you prefer:
let macData = NSMutableData(length: Int(CC_SHA1_DIGEST_LENGTH))!
CCHmac(CCHmacAlgorithm(kCCHmacAlgSHA1),
keyData.bytes, keyData.length,
messageData.bytes, messageData.length,
macData.mutableBytes)
But, those changes -- pointer retrieving properties to `withUnsafeSomething` method -- are intentionally made, which may help Swift compiler generate better code or something like that.
I expect more Swifty interface for CC functions will be provided in the near future (we should send a feature request?), like GCD has become Dispatch library in Swift 3.
And until then, we may need to work with nested `withUnsafeSomething`s or to use good old `NSData` and `NSMutableData`.