---
title: MessageAuthenticationCode
framework: cryptokit
role: symbol
role_heading: Protocol
path: cryptokit/messageauthenticationcode
---

# MessageAuthenticationCode

A type that represents a message authentication code.

## Declaration

```swift
@preconcurrency protocol MessageAuthenticationCode : ContiguousBytes, CustomStringConvertible, Hashable, Sendable, Sequence where Self.Element == UInt8
```

## Topics

### Retrieving the code length

- [byteCount](cryptokit/messageauthenticationcode/bytecount.md)

### Comparing codes

- [==(_:_:)](cryptokit/messageauthenticationcode/==(_:_:)-3rxc4.md)
- [==(_:_:)](cryptokit/messageauthenticationcode/==(_:_:)-b90.md)

### Default Implementations

- [CustomStringConvertible Implementations](cryptokit/messageauthenticationcode/customstringconvertible-implementations.md)

## Relationships

### Inherits From

- [ContiguousBytes](foundation/contiguousbytes.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)
- [Sequence](swift/sequence.md)

### Conforming Types

- [HashedAuthenticationCode](cryptokit/hashedauthenticationcode.md)

## See Also

### Working with codes

- [HMAC.MAC](cryptokit/hmac/mac.md)
- [HashedAuthenticationCode](cryptokit/hashedauthenticationcode.md)
