AES-GMAC
The authentication-only mode of AES-GCM: a nonce-based MAC from GHASH and AES
Overview
GMAC is the authentication-only special case of the Galois/Counter Mode defined in NIST SP 800-38D. It authenticates data without encrypting anything, using the same GHASH polynomial hash and AES-encrypted mask as AES-GCM.
GMAC derives a hash key H by encrypting the zero block with AES, evaluates the GHASH polynomial over the message and its length in GF(2^128) at point H, and XORs the result with the AES encryption of a counter block derived from the nonce. It is extremely fast where carry-less multiplication instructions are available, and parallelisable.
GMAC is used in IPsec (RFC 4543) and in MACsec where integrity without confidentiality is needed. NextSSL exposes AES-GMAC with 128-, 192- and 256-bit AES keys as determined by the key length supplied. In NextSSL it is tiered as standard. GMAC shares the GCM nonce rules, so standard 96-bit nonces are preferred.
History
2007–2007Specified in NIST SP 800-38D
Security notes
GMAC requires a unique nonce for every message under a key. Reusing a nonce allows an attacker to recover the hash key H and forge tags for arbitrary messages. Truncated tags weaken GHASH-based MACs more than most, so SP 800-38D permits short tags only with strict usage limits.
Typical uses
Variants in NextSSL
1| Algorithm | Tier | Sizes (bytes) | Standards | API |
|---|---|---|---|---|
| AES-GMAC aes-gmac |
standard FIPS | key 16–32 · tag 16 · block 12 | NIST SP 800-38D (GMAC) | safe |
Frequently asked questions
Which AES-GMAC variants does NextSSL include?
NextSSL registers 1 AES-GMAC variant: aes-gmac.