---
title: "update(data:)"
framework: cryptokit
role: symbol
role_heading: Instance Method
path: "cryptokit/hmac/update(data:)"
---

# update(data:)

Updates the message authentication code computation with a block of data.

## Declaration

```swift
mutating func update<D>(data: D) where D : DataProtocol
```

## Parameters

- `data`: The data for which to compute the authentication code.

## See Also

### Creating an authentication code iteratively

- [init(key:)](cryptokit/hmac/init(key:).md)
- [finalize()](cryptokit/hmac/finalize().md)
