isValidAuthenticationCode(_:authenticating:using:)

Returns a Boolean value indicating whether the given message authentication code represented as contiguous bytes is valid for a block of data.

HMAC.swift:141
iOS
13+
macOS
10.15+
tvOS
13+
watchOS
6+
static func isValidAuthenticationCode<C, D>(_ authenticationCode: C, authenticating authenticatedData: D, using key: SymmetricKey) -> Bool where C : ContiguousBytes, D : DataProtocol

Parameters

authenticationCode

The authentication code to compare.

authenticatedData

The block of data to compare.

key

The symmetric key for the authentication code.

Returns

A Boolean value that’s true if the message authentication code is valid for the specified block of data.