MAC.initialize

void initialize(const(ubyte)[] key)

Initializes (or re-initializes) the MAC with the given secret key.

This method must be called before updating with data. It can be called again to reset the MAC and use a different key.

Parameters

keyThe secret key bytes. The required length depends on the specific MAC algorithm (e.g., HMAC accepts any length, Poly1305 requires exactly 32 bytes).

Throws

CryptoException if the key is invalid for this MAC algorithm.