Page 1 Page 1
NIST Special Publication 800-38D NIST Special Publication 800-38D
November, 2007 Novembre 2007
Recommendation for Block Recommandation pour le bloc
Cipher Modes of Operation: Cipher modes de fonctionnement:
Galois/Counter Mode (GCM) Mode Galois / Compteur (GCM)
and GMAC et GMAC
Morris Dworkin Morris Dworkin
COMPUTERSECURITY COMPUTERSECURITY

Page 2 Page 2

Page 3 Page 3
Recommendation for Block Recommandation pour le bloc
Cipher Modes of Operation: Cipher modes de fonctionnement:
Galois/Counter Mode (GCM) Mode Galois / Compteur (GCM)
and GMAC et GMAC
Morris Dworkin Morris Dworkin
NIST Special Publication 800-38D NIST Special Publication 800-38D
COMPUTERSECURITY COMPUTERSECURITY
Computer Security Division Division de la sécurité informatique
Information Technology Laboratory Laboratoire de la technologie de l'information
National Institute of Standards and Technology Institut National des Standards et de la Technologie
Gaithersburg, MD 20899-8930 Gaithersburg, MD 20899-8930
November 2007 Novembre 2007
US Department of Commerce US Department of Commerce
Carlos M. Gutierrez, Secretary Carlos M. Gutierrez, le secrétaire
National Institute of Standards and Technology Institut National des Standards et de la Technologie
James M. Turner, Acting Director James M. Turner, directeur par intérim

Page 4 Page 4
NIST Special Publication 800-38D NIST Special Publication 800-38D
Reports on Information Security Technology Rapports sur la sécurité des technologies de l'information
The Information Technology Laboratory (ITL) at the National Institute of Standards and Technology Le Laboratoire de la technologie de l'information (ITL) à l'Institut National des Standards et de la Technologie
(NIST) promotes the US economy and public welfare by providing technical leadership for the Nation's (NIST) favorise l'économie américaine et le bien-être du public en fournissant un leadership technique pour la Nation de
measurement and standards infrastructure. mesure et des normes infrastructure. ITL develops tests, test methods, reference data, proof of ITL développe des tests, méthodes d'essai, les données de référence, la preuve de
concept implementations, and technical analyses to advance the development and productive use of implémentations de concept, et les analyses techniques pour faire avancer le développement et l'utilisation productive de
information technology. technologies de l'information. ITL's responsibilities include the development of technical, physical, Les responsabilités de ITL comprennent le développement de techniques, physiques,
administrative, and management standards and guidelines for the cost-effective security and privacy of et les normes et les lignes directrices de la gestion administrative pour la sécurité économique et la confidentialité des
sensitive unclassified information in Federal computer systems. informations non classés sensibles dans les systèmes fédéraux informatiques. This Special Publication 800-series Cette publication spéciale 800-série
reports on ITL's research, guidance, and outreach efforts in computer security, and its collaborative des rapports sur la recherche, l'orientation, et les efforts de sensibilisation de ITL en sécurité informatique, et sa collaboration
activities with industry, government, and academic organizations. activités avec l'industrie, le gouvernement et les organisations universitaires.
Certain commercial entities, equipment, or materials may be identified in this document in order Certaines entités commerciales, des équipements ou matériaux peuvent être identifiées dans le présent document pour
to describe an experimental procedure or concept adequately. pour décrire une procédure expérimentale ou d'un concept de manière adéquate. Such identification is not intended Cette identification n'est pas destiné
to imply recommendation or endorsement by the National Institute of Standards and Technology, impliquer recommandation ou une approbation par l'Institut National des Standards et de la Technologie,
nor is it intended to imply that the entities, materials, or equipment are necessarily the best et ne vise pas à laisser entendre que l'entités, des matériaux ou des équipements ne sont pas nécessairement le meilleur
available for the purpose. disponible à cet effet.
National Institute of Standards and Technology Special Publication 800-38D Institut National des Standards et de la technologie Publication spéciale 800-38D
Natl. Natl. Inst. Inst. Stand. Stand. Technol. Technol. Spec. Spec. Publ. Publ. 800-38D 37 pages (November 2007) 800-38D 37 pages (novembre 2007)
CODEN: NSPUE2 CODEN: NSPUE2
ii ii

Page 5 Page 5
NIST Special Publication 800-38D NIST Special Publication 800-38D
Acknowledgements Remerciements
The author wishes to thank David McGrew, who co-invented GCM and submitted it to NIST, and also the L'auteur tient à remercier David McGrew, qui a co-inventé GCM et l'a soumis au NIST, et aussi le
author's colleagues who reviewed drafts of this document and contributed to its development, especially Les collègues de l'auteur qui ont examiné les ébauches de ce document et ont contribué à son développement, en particulier
Elaine Barker, John Kelsey, Allen Roginsky, Donna Dodson, Tim Polk, and Bill Burr. Elaine Barker, John Kelsey, Allen Roginsky, Donna Dodson, Tim Polk, et Bill Burr. The author also L'auteur a également
gratefully acknowledges the many comments from the public and private sectors to improve the quality reconnaissance reconnaît les nombreux commentaires des secteurs public et privé pour améliorer la qualité
and usefulness of this publication. et l'utilité de cette publication.
iii iii

Page 6 Page 6
NIST Special Publication 800-38D NIST Special Publication 800-38D
Abstract Résumé
This Recommendation specifies the Galois/Counter Mode (GCM), an algorithm for Cette Recommandation spécifie le mode de Galois / Compteur (GCM), un algorithme de
authenticated encryption with associated data, and its specialization, GMAC, for generating a chiffrement authentifié des données associées, et sa spécialisation, GMAC, pour générer un
message authentication code (MAC) on data that is not encrypted. le code d'authentification de message (MAC) de données qui ne sont pas cryptées. GCM and GMAC are modes GCM et GMAC sont des modes
of operation for an underlying approved symmetric key block cipher. de fonctionnement pour un sous-jacent clé symétrique de chiffrement par bloc approuvé.
KEY WORDS: authenticated encryption; MOTS CLÉS: chiffrement authentifié; authentication; authentification; block cipher; bloquer chiffrement; confidentiality, la confidentialité,
cryptography; cryptographie; encryption; le cryptage; information security; sécurité de l'information; mode of operation. mode de fonctionnement.
iv iv

Page 7 Page 7
NIST Special Publication 800-38D NIST Special Publication 800-38D
Table of Contents Table des matières
1 1
PURPOSE...........................................................................................................................................................1
2 2
AUTHORITY.....................................................................................................................................................1
3 3
INTRODUCTION..............................................................................................................................................1
4 4
DEFINITIONS, ABBREVIATIONS, AND SYMBOLS.................................................................................2 Définitions, abréviations et les symboles ............................................ ..................................... 2
4.1 4.1
D Ré
EFINITIONS AND DEFINITIONS ET
A A
BBREVIATIONS BRÉVIATIONS
.............................................................................................................2
4.2 4.2
S S
YMBOLS YMBOLS
....................................................................................................................................................5
4.2.1 4.2.1
Variables................................................................................................................................................5
4.2.2 4.2.2
Operations and Functions Opérations et des fonctions .....................................................................................................................6
5 5
ELEMENTS OF ÉLÉMENTS DE GCM......................................................................................................................................7
5.1 5.1
B B
LOCK BLOCAGE
C C
IPHER IPHER
............................................................................................................................................7
5.2 5.2
T T
WO WO
GCM F GCM F
UNCTIONS ONCTIONS
...............................................................................................................................7
5.2.1 5.2.1
Authenticated Encryption Chiffrement authentifié Function.......................................................................................................8
5.2.2 5.2.2
Authenticated Decryption Décryptage authentifié Function.......................................................................................................9
5.3 5.3
P P
RIMITIVES FOR RIMITIVES POUR
C C
ONFIDENTIALITY AND ONFIDENTIALITE ET
A A
UTHENTICATION UTHENTICATION
........................................................................9 .................................................. ...................... 9
6 6
MATHEMATICAL COMPONENTS OF GCM...........................................................................................10 COMPOSANTS DE MATHÉMATIQUES MCG .............................................. ............................................. 10
6.1 6.1
E E
XAMPLES OF EXEMPLES DE
B B
ASIC ASIC
O O
PERATIONS AND PERATIONS ET
F Fa
UNCTIONS ON ONCTIONS ON
S S
TRINGS Trings
.............................................................10 .................................................. ........... 10
6.2 6.2
I Je
NCREMENTING NCREMENTING
F Fa
UNCTION ONCTION
........................................................................................................................11
6.3 6.3
M M
ULTIPLICATION ULTIPLICATION
O O
PERATION ON ONCTIONNEMENT ON
B B
LOCKS SERRURES
................................................................................................11 .................................................. .............................................. 11
6.4 6.4
GHASH F Ghash F
UNCTION ONCTION
...................................................................................................................................12
6.5 6.5
GCTR F GCTR F
UNCTION ONCTION
......................................................................................................................................13
7 7
GCM GCM SPECIFICATION.................................................................................................................................14
7.1 7.1
A A
LGORITHM FOR THE LGORITHM POUR LA
A A
UTHENTICATED UTHENTICATED
E E
NCRYPTION NCRYPTION
F Fa
UNCTION ONCTION
..............................................................14 .................................................. ............ 14
7.2 7.2
A A
LGORITHM FOR THE LGORITHM POUR LA
A A
UTHENTICATED UTHENTICATED
D Ré
ECRYPTION Ecryption
F Fa
UNCTION ONCTION
..............................................................16 .................................................. ............ 16
8 8
UNIQUENESS REQUIREMENT ON IVS AND KEYS ..............................................................................18 EXIGENCE UNIQUE SUR IVS ET TOUCHES ............................................ .................................. 18
8.1 8.1
K K
EY EY
E E
STABLISHMENT ETABLISSEMENT
...............................................................................................................................19
8.2 8.2
IV C IV C
ONSTRUCTIONS ONSTRUCTIONS
..................................................................................................................................19
8.2.1 8.2.1
Deterministic Déterministe Construction..................................................................................................................20
8.2.2 8.2.2
RBG-based Base de RBG Construction.....................................................................................................................20
8.3 8.3
C C
ONSTRAINTS ON THE ONTRAINTES SUR LE
N N
UMBER OF OMBRE DE
I Je
NVOCATIONS NVOCATIONS
.....................................................................................21 .................................................. ................................... 21
9 9
PRACTICAL CONSIDERATIONS FOR VALIDATING IMPLEMENTATIONS .................................22 CONSIDERATIONS PRATIQUES POUR VALIDER IMPLÉMENTATIONS ................................. 22
9.1 9.1
D Ré
ESIGN CONCEPTION
C C
ONSIDERATIONS ONSIDÉRATIONS
.........................................................................................................................22
9.2 9.2
O O
PERATIONAL OPERATIONNEL
C C
ONSIDERATIONS ONSIDÉRATIONS
..............................................................................................................23
10 10
CONFORMANCE...........................................................................................................................................24
APPENDIX A: IMPORTANCE OF THE UNIQUENESS REQUIREMENT ON IVS.....................................25 ANNEXE A: importance de l'exigence d'unicité sur IVS ..................................... 25
APPENDIX B: AUTHENTICATION ASSURANCE ...........................................................................................26 ANNEXE B: AUTHENTIFICATION ASSURANCE ............................................. .............................................. 26
APPENDIX C: REQUIREMENTS AND GUIDELINES FOR USING SHORT TAGS....................................28 ANNEXE C: Spécifications et directives pour l'utilisation des balises COURTS .................................... 28
APPENDIX D: PROTECTION AGAINST REPLAY OF MESSAGES.............................................................30 ANNEXE D: PROTECTION CONTRE REPLAY DES MESSAGES .......................................... ................... 30
APPENDIX E: ANNEXE E: BIBLIOGRAPHY..........................................................................................................................31
v v

Page 8 Page 8
NIST Special Publication 800-38D NIST Special Publication 800-38D
vi vi
List of Figures Liste des figures
Figure 1: GHASH Figure 1: ghash
H H
( X (X
1 1
|| X || X
2 2
|| ... || X || ... || X
m m
) = Y ) = Y
m m
................................................................................. 13 .................................................. ............................... 13
Figure 2: GCTR Figure 2: GCTR
K K
( ICB , X (AOI, X
1 1
|| X || X
2 2
|| ... || X || ... || X
n n
* *
) = Y ) = Y
1 1
|| Y || Y
2 2
|| ... || Y || ... || Y
n n
* *
..................................................... 14 .................................................. 14 ...
Figure 3: GCM-AE Figure 3: GCM-AE
K K
( IV , P , A ) = ( C , T ). (IV, P, A) = (C, T). ..................................................................................... 16 .................................................. ................................... 16
Figure 4: GCM-AD Figure 4: GCM-AD
K K
( IV , C , A , T ) = P or FAIL ........................................................................... 18 (IV, C, A, T) = P ou FAIL ..................................... ...................................... 18
List of Tables Liste des tableaux
Table 1: Constraints with 32-bit Tags.......................................................................................... 29 Tableau 1: Contraintes avec 32 bits tags ......................................... ................................................. 29
Table 2: Constraints with 64-bit Tags.......................................................................................... 29 Tableau 2: Contraintes avec 64 bits tags ......................................... ................................................. 29

Page 9 Page 9
NIST Special Publication 800-38D NIST Special Publication 800-38D
1 Purpose 1 But
This publication is the fourth Part in a series of Recommendations regarding modes of operation Cette publication est la quatrième partie d'une série de recommandations concernant les modes de fonctionnement
of symmetric key block ciphers. de chiffrement par blocs symétriques clés.
2 Authority Autorité 2
This document has been developed by the National Institute of Standards and Technology Ce document a été élaboré par l'Institut National des Standards et de la Technologie
(NIST) in furtherance of its statutory responsibilities under the Federal Information Security (NIST) dans la poursuite de ses responsabilités légales en vertu de la sécurité de l'information fédérale
Management Act (FISMA) of 2002, Public Law 107-347. Loi sur la gestion (FISMA) de 2002, Public Law 107-347.
NIST is responsible for developing standards and guidelines, including minimum requirements, NIST est responsable des normes et des lignes directrices en développement, y compris les exigences minimales,
for providing adequate information security for all agency operations and assets, but such pour assurer la sécurité de l'information adéquate pour toutes les opérations et les actifs agence, mais comme
standards and guidelines shall not apply to national security systems. les normes et les lignes directrices ne s'appliquent pas aux systèmes de sécurité nationaux. This guideline is consistent Cette recommandation est conforme
with the requirements of the Office of Management and Budget (OMB) Circular A-130, Section avec les exigences de l'Office of Management and Budget (OMB) Circulaire A-130, Section
8b(3), Securing Agency Information Systems, as analyzed in A-130, Appendix IV: Analysis of 8b (3), des systèmes d'information Agence de fixation, comme analysé dans l'A-130, Annexe IV: Analyse des
Key Sections. Les articles clés. Supplemental information is provided in A-130, Appendix III. Informations supplémentaires sont fournies dans A-130, Annexe III.
This Recommendation has been prepared for use by federal agencies. Cette recommandation a été préparé à l'intention des organismes fédéraux. It may be used by Il peut être utilisé par
nongovernmental organizations on a voluntary basis and is not subject to copyright. des organisations non gouvernementales sur une base volontaire et n'est pas soumis au droit d'auteur. (Attribution (Attribution
would be appreciated by NIST.) serait apprécié par le NIST.)
Nothing in this document should be taken to contradict standards and guidelines made Rien dans ce document ne doit être prise pour contredire les normes et lignes directrices établies
mandatory and binding on federal agencies by the Secretary of Commerce under statutory obligatoire et contraignant sur ​​les organismes fédéraux par le secrétaire au Commerce sous la loi
authority. autorité. Nor should these guidelines be interpreted as altering or superseding the existing Ces lignes directrices ne devraient pas être interprétés comme une modification ou remplaçant le existant
authorities of the Secretary of Commerce, Director of the OMB, or any other federal official. autorités de la secrétaire au Commerce, Directeur de la CAMO, ou tout autre fonctionnaire fédéral.
Conformance testing for implementations of the mode of operation that is specified in this Part Les essais de conformité pour les implémentations du mode de fonctionnement qui est spécifiée dans la présente partie
of the Recommendation will be conducted within the framework of the Cryptographic Module de la Recommandation sera menée dans le cadre du module cryptographique
Validation Program (CMVP), a joint effort of NIST and the Communications Security Programme de validation (PVMC), une initiative conjointe du NIST et de la sécurité des télécommunications
Establishment of the Government of Canada. Mise en place du gouvernement du Canada. An implementation of a mode of operation must Une mise en œuvre d'un mode de fonctionnement doit
adhere to the requirements in this Recommendation in order to be validated under the CMVP. se conformer aux exigences de la présente Recommandation afin d'être validés sous le PVMC.
The requirements of this Recommendation are indicated by the word “shall.” Les exigences de la présente Recommandation sont indiquées par le mot «doit».
3 Introduction 3 Introduction
This Recommendation specifies an algorithm called Galois/Counter Mode (GCM) for Cette Recommandation spécifie un algorithme appelé Galois / Counter Mode (GCM) pour
authenticated encryption with associated data. chiffrement authentifié par des données associées. GCM is constructed from an approved symmetric GCM est construit à partir d'un symétrique approuvé
key block cipher with a block size of 128 bits, such as the Advanced Encryption Standard (AES) clé de chiffrement de bloc à une taille de bloc de 128 bits, comme la norme de cryptage avancée (AES)
algorithm that is specified in Federal Information Processing Standard (FIPS) Pub. algorithme qui est spécifié dans Federal Information Processing Standard (FIPS) du Pub. 197 [ 2]. 197 [ 2].
Thus, GCM is a mode of operation of the AES algorithm. Ainsi, GCM est un mode de fonctionnement de l'algorithme AES.
GCM provides assurance of the confidentiality of data using a variation of the Counter mode of GCM fournit une assurance de la confidentialité des données en utilisant une variante du mode de Counter
operation for encryption. opération de chiffrement. GCM provides assurance of the authenticity of the confidential data GCM fournit l'assurance de l'authenticité des données confidentielles
(up to about 64 gigabytes per invocation) using a universal hash function that is defined over a (Jusqu'à environ 64 giga-octets par invocation) en utilisant une fonction de hachage universelle qui est définie sur un
1 1

Page 10 Page 10
NIST Special Publication 800-38D NIST Special Publication 800-38D
binary Galois (ie, finite) field. binaire Galois (c.-à-fini) domaine. GCM can also provide authentication assurance for additional GCM peut également fournir une garantie d'authentification pour plus d'
data (of practically unlimited length per invocation) that is not encrypted. données (d'une longueur pratiquement illimitée par invocation) qui n'est pas chiffré.
If the GCM input is restricted to data that is not to be encrypted, the resulting specialization of Si l'entrée de GCM est limitée aux données qui ne sont pas à chiffrer, la spécialisation résultant de
GCM, called GMAC, is simply an authentication mode on the input data. GCM, appelé GMAC, est simplement un mode d'authentification sur les données d'entrée. In the rest of this Dans la suite de ce
document, statements about GCM also apply to GMAC. documents, des déclarations concernant GCM s'appliquent également à GMAC.
GCM provides stronger authentication assurance than a (non-cryptographic) checksum or error GCM fournit l'assurance d'authentification plus forte que la somme de contrôle ou d'une erreur (non cryptographique)
detecting code; code de détection; in particular, GCM can detect both 1) accidental modifications of the data and 2) en particulier, GCM peut détecter à la fois 1) les modifications accidentelles de données et 2)
intentional, unauthorized modifications. intentionnelles, des modifications non autorisées.
The two functions of GCM are called authenticated encryption and authenticated decryption. Les deux fonctions des GCM sont appelés chiffrement et le déchiffrement authentifié authentifié.
Each of these functions is relatively efficient and parallelizable; Chacune de ces fonctions est relativement efficace et parallélisable; consequently, high-throughput par conséquent, à haut débit
implementations are possible in both hardware and software. implémentations sont possibles à la fois matériel et logiciel. GCM has several other useful GCM a plusieurs autres utiles
characteristics, including the following: caractéristiques, y compris ce qui suit:
• The GCM functions are “online” in the sense that the lengths of the confidential data • Les fonctions de GCM sont "en ligne" dans le sens où les longueurs des données confidentielles
and the additional, non-confidential data are not required in advance; et les données supplémentaires, non confidentielles ne sont pas nécessaires à l'avance; instead, the à la place, l'
lengths can be calculated as the data arrives and is processed. longueurs peuvent être calculées comme les données arrivent et sont traitées.
• The GCM functions require only the forward direction of the underlying block cipher • Les fonctions de MCG exigent que la direction de l'avant de l'algorithme de chiffrement sous-jacente
(ie, the inverse direction is not required). (C'est à dire, la direction inverse n'est pas nécessaire).
• The authenticity of the protected data can be verified independently from the recovery • L'authenticité des données protégées peut être vérifiée de façon indépendante de la reprise
of the confidential data from its encrypted form. des données confidentielles de sa forme cryptée.
• If the unique initialization string is predictable, and the length of the confidential data is • Si la chaîne d'initialisation unique est prévisible, et la longueur des données confidentielles est
known, then the block cipher invocations within the GCM encryption mechanism can connus, puis les invocations de chiffrement par bloc au sein du mécanisme de cryptage de GCM peut
be pre-computed. être pré-calculée.
• If some or all of the additional, non-confidential data is fixed, then the corresponding • Si une partie ou la totalité des données supplémentaires, non confidentielle est fixe, alors le correspondant
elements of the GCM authentication mechanism can be pre-computed. les éléments du mécanisme d'authentification de GCM peuvent être pré-calculés.
An important caution to the use of GCM is that a breach of the requirement in Sec. Une prudence important à l'utilisation de GCM est que la violation de l'obligation à la Sec. 8 8 for the pour l'
uniqueness of the initialization strings may compromise the security assurance almost entirely, as unicité des chaînes d'initialisation peut compromettre l'assurance de la sécurité presque entièrement, comme
detailed in Ref. [5 ] and summarized in Appendix A. Therefore, this mode of operation should détaillée dans la réf. [5 ] et résumées à l'annexe A. Par conséquent, ce mode de fonctionnement devrait
not be deployed unless compliance with this uniqueness requirement is ensured. pas être déployé si le respect de cette exigence d'unicité est assurée. Some of the Une partie de l'
practical considerations are discussed further in Secs. 9.1 and 9.2. considérations pratiques sont discutés plus en Secs. 9.1 et 9.2.
The designers of GCM are McGrew and Viega. Les concepteurs de GCM sont McGrew et Viega. They submitted GCM to NIST in Ref. Ils ont fait valoir GCM NIST dans Réf. [ 6], and [ 6], et
they discuss in detail its security and performance in Ref. ils discutent en détail de sa sécurité et de performance dans Réf. [ 7]. [ 7].
4 Definitions, Abbreviations, and Symbols 4 Définitions, abréviations et symboles
4.1 Definitions and Abbreviations 4.1 Définitions et abréviations
2 2

Page 11 Page 11
NIST Special Publication 800-38D NIST Special Publication 800-38D
AAD AAD
Additional Authenticated Data Assermentée Données supplémentaires
Additional Supplémentaire
Authenticated Data Assermentée données
The input data to the authenticated encryption function that is Les données d'entrée à la fonction de chiffrement qui est authentifié
authenticated but not encrypted. authentifié mais pas crypté.
AES AES
Advanced Encryption Standard. Advanced Encryption Standard.
Approved Approuvé
FIPS approved or NIST recommended: an algorithm or technique that FIPS approuvé ou NIST recommandé: un algorithme ou technique qui
is either 1) specified in a FIPS or a NIST Recommendation, or 2) est soit 1) spécifiée dans FIPS ou une recommandation NIST, ou 2)
adopted in a FIPS or a NIST Recommendation. adopté dans un FIPS ou une recommandation NIST.
Authenticated Authentifié
Decryption Décryptage
The function of GCM in which the ciphertext is decrypted into the La fonction de MCG, le texte chiffré est déchiffré dans le
plaintext, and the authenticity of the ciphertext and the AAD is clair, et l'authenticité du message et de l'AAD est
verified. vérifié.
Authenticated Authentifié
Encryption Chiffrement
The function of GCM in which the plaintext is encrypted into the La fonction de MCG, le texte en clair est chiffré dans le
ciphertext, and an authentication tag is generated on the AAD and the texte chiffré, et une étiquette d'authentification est généré sur le DAA et le
ciphertext. cryptogramme.
Authentication Tag Authentification Tag
(Tag) (Tag)
A cryptographic checksum on data that is designed to reveal both Une somme de contrôle cryptographique sur des données qui est conçu pour révéler à la fois
accidental errors and the intentional modification of the data. erreurs accidentelles et la modification intentionnelle des données.
Authenticity Authenticité
The property that data originated from its purported source. La propriété que les données proviennent de la source prétendue.
Bit Peu
A binary digit: 0 or 1 . Un chiffre binaire: 0 ou 1.
Bit String Chaîne de bits
A finite, ordered sequence of bits. Une séquence finie, ordonné de bits.
Block Bloquer
For a given block cipher, a bit string whose length is the block size of Par un algorithme de chiffrement par bloc donné, une chaîne de bits dont la longueur est la taille du bloc de
the block cipher. le chiffrement par bloc.
Block Cipher Bloquer Cipher
A parameterized family of permutations on bit strings of a fixed Une famille paramétrée de permutations sur les chaînes de bits d'un fixe
length; longueur; the parameter that determines the permutation is a bit string le paramètre qui détermine la permutation est une chaîne de bits
called the key. appelée la clé.
Block Size Taille de bloc
For a given block cipher and key, the fixed length of the input (or Par un algorithme de chiffrement et la clé de bloc donné, la longueur fixe de l'entrée (ou
output) bit strings. sortie des chaînes) de bits.
Byte Octet
A sequence of 8 bits. Une séquence de 8 bits.
Byte String Octet cordes
A finite, ordered sequence of bytes. Une séquence finie, ordonnée d'octets.
Ciphertext Cryptogramme
The encrypted form of the plaintext. La forme cryptée du texte en clair.
3 3

Page 12 Page 12
NIST Special Publication 800-38D NIST Special Publication 800-38D
Direct Random String Direct chaîne aléatoire
In the RBG-based construction of IVs, an output string of an RBG Dans la construction de VI, un cordage de sortie d'un RBG base RBG
that is used as the random field for an IV. que l'on utilise comme champ aléatoire pour une IV.
Exclusive-OR OU exclusif
The bitwise addition, modulo 2, of two bit strings of equal length. L'addition au niveau du bit, modulo 2, de deux chaînes de bits de longueur égale.
FIPS FIPS
Federal Information Processing Standard. Federal Information Processing Standard.
Fixed Field Champ fixe
In the deterministic construction of IVs, the field that identifies the Dans la construction déterministe de VI, le champ qui identifie le
device or context for the instance of the authenticated encryption dispositif ou le contexte de l'instance de chiffrement authentifié
function. fonction.
Forward Cipher Avant Cipher
Function Fonction
A permutation on blocks that is determined by the choice of a key for Une permutation de blocs qui est déterminée par le choix d'une clé pour
a given block cipher. un chiffrement par bloc donné.
Free Field Champ libre
In the RBG-based construction of IVs, the field whose contents are Dans la construction de VI, le champ dont le contenu est basé sur RBG
not restricted. pas limité.
Fresh Frais
For a newly generated key, the property of being unequal to any Pour une nouvelle clé générée, la propriété d'être inégal à tout
previously used key. clé utilisée précédemment.
GCM GCM
Galois/Counter Mode Mode Galois / Compteur
ICB ICB
Initial Counter Block Bloquer initial du compteur
Initialization Vector Vecteur d'initialisation
A nonce that is associated with an invocation of authenticated Un nonce qui est associé à une invocation de authentifié
encryption on a particular plaintext and AAD. chiffrement sur ​​un texte clair et AAD particulier.
Inverse Cipher Function The function that is the inverse of the forward cipher function for a Inverse Cipher Fonction La fonction qui est l'inverse de la fonction de chiffrement avant de
given key. clé donnée.
Invocation Field Invocation de terrain
In the deterministic construction of IVs, the field that identifies the Dans la construction déterministe de VI, le champ qui identifie le
sets of inputs to the authenticated encryption function in a particular jeux d'entrées à la fonction de chiffrement authentifié à un particulier
device or context. dispositif ou le contexte.
IT IT
Information Technology Informatique
IV IV
Initialization Vector Vecteur d'initialisation
Key Clé
The parameter of the block cipher that determines the selection of the Le paramètre de chiffrement par bloc qui détermine la sélection de l'
forward cipher function from the family of permutations. transmettre fonction de chiffrement de la famille des permutations.
Least Significant Bit(s) Least Significant Bit (s)
The right-most bit(s) of a bit string. Le bit (s) le plus à droite d'une chaîne de bits.
Mode of Operation Mode de fonctionnement
(Mode) (Mode)
An algorithm for the cryptographic transformation of data that is Un algorithme pour la transformation cryptographique de données qui est
based on a block cipher. basé sur un algorithme de chiffrement par bloc.
4 4

Page 13 Page 13
NIST Special Publication 800-38D NIST Special Publication 800-38D
Most Significant Bit(s) La plupart Bit (s) significative
The left-most bit(s) of a bit string. Le bit (s) le plus à gauche d'une chaîne de bits.
NIST NIST
National Institute of Standards and Technology. Institut National des Standards et de la Technologie.
Nonce Nonce
A value that is used only once within a specified context. Une valeur qui est utilisé seulement une fois dans un contexte donné.
Permutation Permutation
An invertible function. Une fonction inversible.
Plaintext Plaintext
The input data to the authenticated encryption function that is both Les données d'entrée à la fonction de chiffrement authentifié qui est à la fois
authenticated and encrypted. authentifié et crypté.
Random Field Random Field
In the RBG-based construction of IVs, either a direct random string Dans la construction à base de RBG de perfusions, soit une chaîne aléatoire directe
or one of its successors. ou l'un de ses successeurs.
RBG RBG
Random Bit Generator Générateur de bits aléatoires
Successor Successeur
In the RBG-based construction of IVs, the result of one or more Dans la construction à base de RBG de VI, le résultat d'un ou plusieurs
applications of the appropriate incrementing function to a direct applications de la fonction d'incrémentation appropriée à une directe
random string. chaîne aléatoire.
XOR XOR
Exclusive-OR. OU exclusif.
4.2 Symbols 4.2 Symboles
4.2.1 Variables 4.2.1 Variables
A A
The additional authenticated data Les données authentifiées supplémentaire
C C
The ciphertext. Le cryptogramme.
H H
The hash subkey. La sous-clé de hachage.
ICB ICB
The initial counter block Le bloc compteur initial
IV IV
The initialization vector. Le vecteur d'initialisation.
K K
The block cipher key. La clé de chiffrement par bloc.
P P
The plaintext. Le texte en clair.
R R
The constant within the algorithm for the block multiplication operation. La constante à l'intérieur de l'algorithme pour le fonctionnement bloc de multiplication.
T T
The authentication tag. L'étiquette d'authentification.
t t
The bit length of the authentication tag. La longueur en bits de l'étiquette d'authentification.
5 5

Page 14 Page 14
NIST Special Publication 800-38D NIST Special Publication 800-38D
4.2.2 Operations and Functions 4.2.2 opérations et des fonctions
0 0
s s
The bit string that consists of s ' 0 ' bits. La chaîne de bits qui est constitué des «bits 0 s.
CIPH ICPC
K K
( X ) (X)
The output of the forward cipher function of the block cipher under the La sortie de la fonction de chiffrement de l'avant du bloc de chiffrement sous l'
key K applied to the block X . clé K appliqué au bloc X.
GCTR GCTR
K K
( ICB , X ) (AOI, X)
The output of the GCTR function for a given block cipher with key K La sortie de la fonction de GCTR pour un chiffrement par bloc donné avec la clé K
applied to the bit string X with an initial counter block ICB . appliqué à la chaîne de bits X avec un bloc ICB initial du compteur.
GHASH Ghash
H H
( X ) (X)
The output of the GHASH function under the hash subkey H applied to La sortie de la fonction de ghash sous la sous-clé de hachage H appliqué à
the bit string X . la chaîne de bits X.
inc inc
s s
( X ) (X)
The output of incrementing the right-most s bits of the bit string X , La sortie du incrémenter le plus à droite de bits de la chaîne de bits X,
regarded as the binary representation of an integer, by 1 modulo 2 considérée comme la représentation binaire d'un nombre entier, par une modulo 2
s s
. .
int( X ) int (X)
The integer for which the bit string X is a binary representation. Le nombre entier pour lequel la chaîne de bits X est une représentation binaire.
len( X ) len (X)
The bit length of the bit string X . La longueur en bits de la chaîne de bits X.
LSB LSB
s s
( X ) (X)
The bit string consisting of the s right-most bits of the bit string X . La chaîne de bits composée des s les plus à droite des bouts de la chaîne de bits X.
MSB MSB
s s
( X ) (X)
The bit string consisting of the s left-most bits of the bit string X . La chaîne de bits constitué par les s bits de la chaîne de bits X plus à gauche.
⎡ x ⎤ ⎡ ⎤ x
The least integer that is not less than the real number x . Le plus petit entier qui n'est pas inférieur au nombre réel x.
[ x ] [X]
s s
The binary representation of the non-negative integer x as a string of s bits, La représentation binaire de l'entier non négatif x en tant que chaîne de s bits,
where x <2 où x <2
s s
. .
X >> 1 X >> 1
The bit string that results from discarding the rightmost bit of the bit string La chaîne de bits qui résultent de rejet du bit le plus à droite de la chaîne de bits
X and prepending a ' 0 ' bit on the left. X et précéder un peu «0» sur la gauche.
X || Y X || Y
The concatenation of two bit strings X and Y . La concaténation de deux chaînes de bits X et Y.
X ⊕ Y X ⊕ Y
The bitwise exclusive-OR of two bit strings X and Y of the same length. Le bit à bit OU exclusif de deux chaînes de bits X et Y de la même longueur.
X • Y X • Y
The product of two blocks, X and Y , regarded as elements of a certain Le produit de deux blocs, X et Y, considérés comme des éléments d'un certain
binary Galois field. binaire Galois.
X X
i Je
For a positive integer i , the i th power of X under the product '•'. Pour un entier positif i, la i-ième puissance de X sous l'article '•'.
x · y x · y
The product of two integers, x and y . Le produit de deux nombres entiers, x et y.
6 6

Page 15 Page 15
NIST Special Publication 800-38D NIST Special Publication 800-38D
5 Elements of GCM 5 éléments de GCM
The elements of GCM and the associated notation and requirements are introduced in the three Les éléments de GCM et la notation et de leurs conditions sont introduits dans les trois
sections below. sections ci-dessous. The underlying block cipher and key are discussed in Sec. 5.1 . Le chiffrement par bloc sous-jacent et la clé sont traités à la Sec. 5.1 . The data Les données
elements of the authenticated encryption and authenticated decryption functions of GCM are éléments du chiffrement authentifié et fonctions de décryptage authentifiés de GCM sont
discussed in Sec. 5.2 . discuté en Sec. 5.2 . The cryptographic primitives for confidentiality and authentication within Les primitives cryptographiques pour la confidentialité et l'authentification dans
these two functions are discussed in Sec. ces deux fonctions sont traités à la Sec. 5 .3. 5 .3.
5.1 Block Cipher 5.1 Bloquer Cipher
The operations of GCM depend on the choice of an underlying symmetric key block cipher and Les opérations de GCM dépendent du choix d'un bloc de clé de chiffrement symétrique sous-jacent et
thus can be considered a mode of operation (mode, for short) of the block cipher. peut donc être considéré comme un mode de fonctionnement (mode, pour faire court) du bloc de chiffrement. The GCM key La clé GCM
is the block cipher key (the key, for short). est la clé de chiffrement par bloc (la touche, pour faire court).
For any given key, the underlying block cipher of the mode consists of two functions that are Pour une touche donnée, le chiffrement par bloc sous-jacent de mode est constitué de deux fonctions qui sont
inverses of each other. inverses l'une de l'autre. The choice of the block cipher includes the designation of one of the two Le choix du chiffrement par blocs comprend la désignation de l'un des deux
functions of the block cipher as the forward cipher function, as in the specification of the AES les fonctions du bloc de chiffrage à la fonction de chiffrement de l'avant, comme dans la description de l'AES
algorithm in Ref. [2] . algorithme Réf. [2] . GCM does not employ the inverse cipher function. GCM n'emploie pas la fonction inverse de chiffrement.
The forward cipher function is a permutation on bit strings of a fixed length; La fonction de chiffrement est une permutation de l'avant sur ​​les chaînes de bits de longueur fixe; the strings are les cordes sont
called blocks. appelés blocs. The length of a block is called the block size. La longueur d'un bloc est appelée la taille de bloc. The key is denoted K , and the La clé est notée K, et la
resulting forward cipher function of the block cipher is denoted CIPH résultant fonction avant de chiffrement de chiffrement par bloc est notée ICPC
K K
. .
The underlying block cipher shall be approved, the block size shall be 128 bits, and the key size Le chiffrement par bloc sous-jacente doit être approuvé, la taille du bloc est de 128 bits, et la taille de la clé
shall be at least 128 bits. doit être d'au moins 128 bits. The key shall be generated uniformly at random, or close to uniformly La clé sera générée uniformément au hasard, ou à proximité de manière uniforme
at random, ie, so that each possible key is (nearly) equally likely to be generated. au hasard, c'est à dire, de sorte que chaque touche est possible (presque) tout aussi susceptibles d'être générés.
Consequently, the key will be fresh, ie, unequal to any previous key, with high probability. Par conséquent, la clé sera frais, c'est à dire, inégal à n'importe quelle touche précédente, avec une forte probabilité. The La
key shall be secret and shall be used exclusively for GCM with the chosen block cipher. clé doit rester secrète et doit être utilisé exclusivement pour GCM avec le chiffrement par bloc choisi.
Additional requirements on the establishment and management of keys are discussed in Sec. Des exigences supplémentaires sur la création et la gestion de clés sont traités à la Sec. 8 .1. 8 .1.
5.2 Two GCM Functions 5.2 Deux fonctions de MCG
The two functions that comprise GCM are called authenticated encryption and authenticated Les deux fonctions qui composent GCM sont appelés chiffrement authentifié et authentifiés
decryption. décryptage. The authenticated encryption function encrypts the confidential data and computes La fonction de chiffrement authentifié crypte les données et calcule confidentielles
an authentication tag on both the confidential data and any additional, non-confidential data. une étiquette d'authentification sur les deux données confidentielles et des données supplémentaires non-confidentielles. The La
authenticated decryption function decrypts the confidential data, contingent on the verification of fonction de décryptage authentifié décrypte les données confidentielles, subordonnées à la vérification des
the tag. l'étiquette.
An implementation may restrict the input to the non-confidential data, ie, without any Une mise en œuvre peut limiter l'entrée de données non-confidentiel, c'est à dire, sans aucun
confidential data. données confidentielles. The resulting variant of GCM is called GMAC. La variante résultant de GCM est appelé GMAC. For GMAC, the authenticated Pour GMAC, le authentifié
encryption and decryption functions become the functions for generating and verifying an les fonctions de chiffrement et de déchiffrement deviennent les fonctions de génération et de vérification d'une
authentication tag on the non-confidential data. authentification tag sur les données non confidentielles.
The requirements and notation for the input and output data of these functions are discussed in Les exigences et les notations pour les données de ces fonctions d'entrée et de sortie sont traités dans
Secs. 5.2.1 and 5.2.2. Secondes. 5.2.1 et 5.2.2. Algorithms for computing these functions are given in Sec. Algorithmes pour le calcul de ces fonctions sont donnés dans la Sec. 7. 7.
7 7

Page 16 Page 16
NIST Special Publication 800-38D NIST Special Publication 800-38D
5.2.1 Authenticated Encryption Function Fonction 5.2.1 assermentée cryptage
5.2.1.1 Input Data 5.2.1.1 Données d'entrée
Given the selection of an approved block cipher and key, there are three input strings to the Compte tenu de la sélection d'un algorithme de chiffrement par bloc et approuvé clé, il existe trois chaînes à l'entrée
authenticated encryption function: authentifié fonction de chiffrement:
• a plaintext, denoted P ; • un texte clair, noté P;
• additional authenticated data (AAD), denoted A ; • données authentifiées supplémentaires (AAD), notés A; and et
• an initialization vector (IV), denoted IV . • un vecteur d'initialisation (IV), notée IV.
The plaintext and the AAD are the two categories of data that GCM protects. Le clair et l'AAD sont les deux catégories de données que GCM protège. GCM protects the GCM protège l'
authenticity of the plaintext and the AAD; l'authenticité du texte en clair et le DAA; GCM also protects the confidentiality of the plaintext, GCM protège également la confidentialité du texte en clair,
while the AAD is left in the clear. tandis que l'AAD est laissé en clair. For example, within a network protocol, the AAD might Par exemple, dans un protocole de réseau, la puissance de AAD
include addresses, ports, sequence numbers, protocol version numbers, and other fields that inclure les adresses, les ports, les numéros de séquence, les numéros de version de protocole, et d'autres domaines que
indicate how the plaintext should be treated. indiquer comment le texte en clair doit être traitée.
The IV is essentially a nonce, ie, a value that is unique within the specified context, which Le IV est essentiellement un nonce, c'est à dire, une valeur qui est unique dans le contexte spécifié, qui
determines an invocation of the authenticated encryption function on the input data to be détermine une invocation de la fonction de chiffrement authentifié sur les données d'entrée soit
protected. protégé. The uniqueness requirement on the IVs (and keys) is stated precisely in Sec. 8 , and L'exigence d'unicité sur les VI (et touches) est indiquée avec précision dans la Sec. 8 , et
two frameworks for constructing IVs are given in Sec. deux cadres pour la construction intraveineuses sont donnés dans la Sec. 8. 2. Practical considerations in assuring 8. 2. considérations pratiques en assurant
the requirement are discussed in Secs. 9.1 and 9.2. l'exigence sont discutés dans Sec. 9.1 et 9.2. The critical importance of the uniqueness of L'importance cruciale de l'unicité de
the IVs is detailed in Ref . la intraveineuses est détaillée dans la référence . [ 5] and summarized in Appendix A. [ 5] et résumées à l'annexe A.
The bit lengths of the input strings to the authenticated encryption function shall meet the Les longueurs des cordes d'entrée à la fonction de chiffrement authentifié doivent satisfaire à la
following requirements: exigences suivantes:
• len( P ) ≤ 2 • len (P) ≤ 2
39 39
-256; -256;
• len( A ) ≤ 2 • len (A) ≤ 2
64 64
-1; -1;
• 1 ≤ len( IV ) ≤ 2 • 1 ≤ len (IV) ≤ 2
64 64
-1. -1.
Although GCM is defined on bit strings, the bit lengths of the plaintext, the AAD, and the IV Bien que GCM est définie sur les chaînes de bits, les longueurs de bits de texte clair, le DAS et le IV
shall all be multiples of 8, so that these values are byte strings. doivent tous être des multiples de 8, de sorte que ces valeurs sont des chaînes d'octets.
An implementation may further restrict the bit lengths of these inputs, consistent with the above Une mise en œuvre peut en outre limiter les longueurs de bits de ces entrées, conformément à ce qui précède
requirements; exigences; for example, an implementation may establish smaller maximum values. par exemple, une application peut établir des valeurs maximales de plus petite taille. The bit Trépan
lengths that an implementation allows are called the supported bit lengths. longueurs qui permet une mise en œuvre sont appelés les longueurs de bits pris en charge. A single set of Un ensemble unique de
supported bit lengths for each of the three inputs should be established for the entire des longueurs de bits pris en charge pour chacune des trois entrées doivent être établies pour l'ensemble de
implementation, independent of the key. mise en oeuvre, indépendamment de la clé.
For IVs, it is recommended that implementations restrict support to the length of 96 bits, to Pour IVs, il est recommandé de limiter les mises en œuvre à l'appui de la longueur de 96 bits, à
promote interoperability, efficiency, and simplicity of design. promouvoir l'interopérabilité, l'efficacité et la simplicité de la conception.
5.2.1.2 Output Data 5.2.1.2 Données de sortie
The following two bit strings comprise the output data of the authenticated encryption function: Les deux chaînes de bits suivants comprennent les données de sortie de la fonction de chiffrement authentifié:
8 8

Page 17 Page 17
NIST Special Publication 800-38D NIST Special Publication 800-38D
• A ciphertext, denoted C , whose bit length is the same as that of the plaintext. • un texte chiffré, notée C, dont la longueur binaire est identique à celle du texte en clair.
• An authentication tag, or tag, for short, denoted T . • Une étiquette d'authentification, ou tag, pour faire court, noté T.
The bit length of the tag, denoted t , is a security parameter, as discussed in Appendix B . In La longueur de bit de la variable, t noté, est un paramètre de sécurité, comme indiqué à l'annexe B. En
general, t may be any one of the following five values: 128, 120, 112, 104, or 96. For certain général, t peut être l'un quelconque des cinq valeurs suivantes: 128, 120, 112, 104, ou 96 pour certaines
applications, t may be 64 or 32; applications, t peuvent être 64 ou 32; guidance for the use of these two tag lengths, including des conseils pour l'utilisation de ces deux longueurs d'étiquettes, y compris
requirements on the length of the input data and the lifetime of the key in these cases, is given in les exigences relatives à la longueur des données d'entrée et la durée de vie de la clé dans ce cas, est donnée dans le
Appendix C. Annexe C.
An implementation shall not support values for t that are different from the seven choices in the Une mise en œuvre ne doit pas soutenir les valeurs de t qui sont différents des sept choix dans la
preceding paragraph. paragraphe précédent. An implementation may restrict its support to as few as one of these Une mise en œuvre peut limiter son soutien à aussi peu que l'un de ces
values. valeurs. A single, fixed value for t from among the supported choices shall be associated with Une seule valeur, fixée pour t parmi les choix pris en charge doit être associée à
each key. chaque touche.
5.2.2 Authenticated Decryption Function 5.2.2 assermentée décryptage Fonction
Given the selection of an approved block cipher, key, and an associated tag length, the inputs to Compte tenu de la sélection d'un chiffrement par bloc approuvé, clé, et une longueur d'étiquette associé, les entrées
the authenticated decryption function are values for IV , A , C , and T , as described in Sec. 5.2.1 la fonction de décryptage authentifié sont des valeurs pour IV, A, C, et T, comme décrit dans la Sec. 5.2.1
above. ci-dessus. The output is one of the following: La sortie est l'un des suivants:
• the plaintext P that corresponds to the ciphertext C , or • le texte en clair P qui correspond au texte chiffré C, ou
• a special error code, denoted FAIL in this document. • un code d'erreur spécifique, notée FAIL dans le présent document.
The output P indicates that T is the correct authentication tag for IV , A , and C ; La sortie P indique que T est la balise d'authentification correcte pour IV, A, et C; otherwise, the autrement, le
output is FAIL . sortie est FAIL. The authentication assurance that can be inferred in each case is discussed in L'assurance d'authentification qui peut être déduit dans chaque cas est examiné en
Appendix B. Annexe B.
The values for len( C ), len ( A ), and len( IV ) that an implementation supports for the authenticated Les valeurs de len (C), len (A), et len (IV) qui prend en charge une implémentation pour le authentifié
decryption function shall be the same as the values for len( P ), len ( A ), and len( IV ) that the la fonction de décryptage est la même que pour les valeurs len (P), len (A), et len (IV) que l'
implementation supports for the authenticated encryption function. mise en œuvre prend en charge pour la fonction de chiffrement authentifié.
5.3 Primitives for Confidentiality and Authentication 5.3 Primitives de confidentialité et d'authentification
The mechanism for the confidentiality of the plaintext within GCM is a variation of the Counter Le mécanisme de la confidentialité du texte en clair dans GCM est une variante de la lutte contre
mode [ 10], with a particular incrementing function, denoted inc mode [ 10], avec une fonction d'incrémentation particulier, inc notée
32 32
, for generating the necessary , Pour produire le nécessaire
sequence of counter blocks. séquence de blocs compteurs. The first counter block for the plaintext encryption is generated by Le premier bloc de compteur pour le chiffrement de texte en clair est généré par
incrementing a block that is generated from the IV. incrémenter un bloc qui est généré à partir du IV.
The authentication mechanism within GCM is based on a hash function, called GHASH Le mécanisme d'authentification à l'intérieur de GCM est basée sur une fonction de hachage, appelée ghash
1 1
, that , Qui
features multiplication by a fixed parameter, called the hash subkey, within a binary Galois field. dispose d'une multiplication par un paramètre fixe, appelé la sous-clé de hachage, dans un champ de Galois binaire.
1 1
The designers of GCM define GHASH somewhat differently, appending encodings of the lengths of its two Les concepteurs de GCM définissent ghash un peu différemment, ajoutant codages des longueurs de ses deux
arguments. arguments. In this Recommendation, these encodings are incorporated instead into the definitions of the Dans cette Recommandation, ces codages sont incorporés à la place dans les définitions de la
authenticated encryption/decryption functions. fonctions de cryptage / décryptage authentifiés. The specifications of the authenticated encryption/decryption Les spécifications du cryptage / décryptage authentifié
functions are ultimately equivalent, but the simplified version of GHASH in this Recommendation does not obtain fonctions sont finalement équivalent, mais la version simplifiée de ghash dans la présente Recommandation n'obtient pas
all of the properties that are shown for the designers' definition of GHASH in Ref. toutes les propriétés qui sont illustrées pour la définition des concepteurs de ghash dans Réf. [7]. [7].
9 9

Page 18 Page 18
NIST Special Publication 800-38D NIST Special Publication 800-38D
The hash subkey, denoted H , is generated by applying the block cipher to the “zero” block. La sous-clé de hachage, notée H, est généré en appliquant le chiffrement par bloc à bloc "zéro". The La
resulting instance of this hash function, denoted GHASH exemple de cette fonction de hachage, notée ghash
H H
, is used to compress an encoding of , Est utilisé pour comprimer un codage d'
the AAD and the ciphertext into a single block, which is then encrypted to produce the l'AAD et le texte chiffré en un seul bloc, qui est ensuite chiffré pour produire le
authentication tag. authentification tag.
GHASH is a keyed hash function but not, on its own, a cryptographic hash function. Ghash est une fonction de hachage à clé, mais pas, à lui seul, une fonction de hachage cryptographique. This Ce
Recommendation only approves GHASH for use within the context of GCM. Recommandation autorise seulement ghash pour une utilisation dans le cadre de GCM.
The intermediate values in the execution of the GCM functions shall be secret. Les valeurs intermédiaires dans l'exécution des fonctions de GCM sont secrètes. In particular, this En particulier, cette
requirement precludes a system in which GCM is implemented using the hash subkey publicly exigence s'oppose à un régime dans lequel GCM est implémenté en utilisant la sous-clé de hachage publiquement
for some other purpose, for example, as an unpredictable value or as an integrity check value on à d'autres fins, par exemple comme une valeur aléatoire ou sous forme de valeur de vérification d'intégrité sur
the key. la clé.
6 Mathematical Components of GCM 6 Composants mathématique de GCM
This section presents the mathematical components that appear in the specifications of the Cette section présente les composantes mathématiques qui apparaissent dans les spécifications de la
authenticated encryption and authenticated decryption functions in Sec. chiffrement authentifié et fonctions de décryptage authentifiés à Sec. 7 below. 7 ci-dessous. Examples of Des exemples d'
the basic operations and functions on bit strings are given in Sec. 6. 1. les opérations et les fonctions de base sur les chaînes de bits sont donnés dans la Sec. 6. 1. The incrementing function La fonction incrémentation
is defined in Sec. 6. 2. est défini dans la Sec. 6. 2. Algorithm 1 for “multiplying” blocks is defined in Sec. Algorithme 1 pour les blocs "multiplicateurs" est défini dans la Sec. 6.3. 6.3. Algorithm 2 Algorithme 2
for the GHASH function that is constructed from this multiplication is defined in Sec 6 .4. pour la fonction de ghash qui est construit à partir de cette multiplication est définie à Sec 6 0,4.
Algorithm 3 for the GCTR function is defined in Sec. Algorithme 3 pour la fonction de GCTR est défini en Sec. 6 .5. 6 .5.
The specifications of Algorithms 1-3 include the inputs, the outputs, the steps of the algorithm, Les spécifications des algorithmes 1-3 comprennent les entrées, les sorties, les étapes de l'algorithme,
diagrams, and summaries. des diagrammes et des résumés. Equivalent sets of steps that produce the correct output are permitted. Ensembles équivalents de mesures qui produisent la sortie correcte sont autorisés.
The inputs that are typically fixed across many invocations of the function are called the Les entrées qui sont généralement fixés à travers de nombreux appels de la fonction sont appelés
prerequisites, although they may also be regarded as (varying) inputs. conditions préalables, mais elles peuvent aussi être considérées comme (variable) entrées.
6.1 Examples of Basic Operations and Functions on Strings 6.1 Exemples d'opérations de base et Fonctions sur les chaînes
In this document, the ' 0 ' bit and the ' 1 ' bit are indicated in the new courier font to help Dans ce document, le "0" et le bit "1" bit sont indiqués dans la nouvelle police de messagerie pour aider
distinguish them from the integers 0 and 1. les distinguer parmi les nombres entiers 0 et 1.
Given a real number x , the ceiling function, denoted ⎡ x ⎤, is the least integer that is not less than x . Compte tenu d'un nombre réel x, la fonction de plafond, notée x ⎡ ⎤, est le plus petit entier qui n'est pas inférieur à x.
For example, ⎡2.1⎤ = 3, and ⎡4⎤ = 4. Par exemple, ⎡2.1⎤ = 3, et ⎡4⎤ = 4.
Given a positive integer s , 0 Étant donné un entier positif s, 0
s s
denotes the string that consists of s ' 0 ' bits. désigne la chaîne qui est constitué des «bits 0 s. For example, 0 Par exemple, 0
8 8
= =
00000000 . 00000000.
The concatenation operation on bit strings is denoted ||; L'opération de concaténation sur les chaînes de bits est notée ||; for example, 001 || 10111 = par exemple, 001 || 10111 =
00110111 . 00110111.
Given bit strings of equal length, the exclusive-OR (XOR) operation, denoted ⊕, specifies the Chaînes de bits données de longueur égale, le OU exclusif (XOR), notée ⊕, précise le
addition, modulo 2, of the bits in each bit position, ie, without carries. addition modulo 2, des bits dans chaque position de bit, c'est à dire, sans porte. For example, 10011 ⊕ Par exemple, 10 011 ⊕
10101 = 00110 . 10101 = 00110.
10 10

Page 19 Page 19
NIST Special Publication 800-38D NIST Special Publication 800-38D
Given a bit string X , the bit length of X is denoted len( X ). Compte tenu d'une chaîne de bits X, la longueur de bit de X est notée len (X). For example, len( 00010 )=5. Par exemple, len (00010) = 5.
Given a bit string X and a non-negative integer s such that len( X )≥ s , the functions LSB Étant donné une chaîne de bits X et telle que len (X) ≥ s d'un entier non-négatif, les fonctions LSB
s s
( X ) and (X) et
MSB MSB
s s
( X ) return the s least significant (ie, right-most) bits and the s most significant (ie, left- (X) renvoyer les s moins important (plus à droite) et les morceaux de la plus importante (c'est-à-gauche
most) bits, respectively, of X . la plupart) bits, respectivement, d'X.
For example, LSB Par exemple, LSB
3 3
( 111011010 ) = 010 , and (111011010) = 010, et
MSB MSB
4 4
( 111011010 ) = 1110 . (111011010) = 1110.
Given a bit string X , the (single) right-shift function, denoted X >> 1, is MSB Étant donné une chaîne de bits X, la (seule) fonction de décalage à droite, notée X >> 1, est MSB
len( X ) len (X)
( 0 || X ). (0 || X). For Pour
example, 0110111 >> 1 = 0011011 . par exemple, 1 = >> 0110111 0011011.
Given a positive integer s and a non-negative integer x that is less than 2 Etant donné un nombre entier positif et s un nombre entier non-négatif x qui est inférieur à 2
s s
, the integer-to-string , La chaîne entière de-
function, denoted [ x ] fonction, notée [x]
s s
, is the binary representation of x as a string of bit length s with the least , Est la représentation binaire de x en tant que chaîne de bits de longueur avec le moins
significant bit on the right. bit significatif sur la droite. For example, for the (base 10) integer 39, the binary representation Par exemple, pour le (base 10) entier 39, la représentation binaire
(base 2) is 100111 , so [39] (Base 2) est 100111, si [39]
8 8
= 00100111 . = 00100111.
Given a (non-empty) bit string X , the string-to-integer function, denoted int( X ), is the integer x Compte tenu d'une (non vide) chaîne de bits X, la fonction string-à-entier, int noté (X), est le nombre entier x
such that [ x ] de telle sorte que [x]
len( X ) len (X)
= X . = X. In other words, int( X ) is the non-negative integer less than 2 En d'autres termes, int (X) est l'entier non négatif inférieur à 2
len( X ) len (X)
whose dont
binary representation is X . représentation binaire est X. For example, int( 00011010 ) = 26. Par exemple, int (00011010) = 26.
6.2 Incrementing Function 6.2 Fonction d'incrémentation
For a positive integer s and a bit string X such that len( X )≥ s , let the s -bit incrementing function, Pour tels que len (X) ≥ s, laisser la fonction de bits incrémenter un entier positif s et une chaîne de bits X,
denoted inc notée inc
s s
( X ), be defined as follows: (X), définie comme suit:
inc inc
s s
( X )=MSB (X) = MSB
len( X )- s len (X) - s
( X ) || [int(LSB (X) || [int (LSB
s s
( X ))+1 mod 2 (X)) + 1 mod 2
s s
] ]
s s
In other words, the function increments the right-most s bits of the string, regarded as the binary En d'autres termes, la fonction incrémente le plus à droite de bits de la chaîne, considéré comme le binaire
representation of an integer, modulo 2 représentation d'un nombre entier, modulo 2
s s
; ; the remaining, left-most len( X )- s bits remain unchanged. le reste, le plus à gauche len (X) - s bits restent inchangés.
6.3 Multiplication Operation on Blocks 6.3 Multiplication opération sur les blocs
Let R be the bit string 11100001 || 0 Soit R la chaîne de bits 11100001 || 0
120 120
. . Given two blocks X and Y , Algorithm 1 below Étant donné deux blocs X et Y, l'algorithme 1 ci-dessous
computes a “product” block, denoted X • Y : calcule un bloc "produit", notée X • Y:
Algorithm 1: X • Y Algorithme 1: X • Y
Input : Entrée:
blocks X , Y . blocs X, Y.
Output : Sortie:
block X • Y . bloc X • Y.
Steps : Étapes:
1. 1.
Let x Soit x
0 0
x x
1 1
...x X ...
127 127
denote the sequence of bits in X . désigner la séquence de bits dans X.
2. 2.
Let Z Laissez Z
0 0
= 0 = 0
128 128
and V et V
0 0
= Y . = Y.
3. 3.
For i = 0 to 127, calculate blocks Z Pour i = 0 à 127, calculer blocs Z
i +1 i 1
and V et V
i +1 i 1
as follows: comme suit:
11 11

Page 20 Page 20
NIST Special Publication 800-38D NIST Special Publication 800-38D
12 12
Z Z
i +1 i 1
= =
Z Z
i Je
if x si x
i Je
= 0; = 0;
Z Z
i Je
⊕ V ⊕ V
i Je
if x si x
i Je
=1. = 1.
⎧ ⎧
⎨ ⎨
⎩ ⎩
V V
i +1 i 1
= =
V V
i Je
>>1 1 >>
if LSB si LSB
1 1
( V (V
i Je
) = 0; ) = 0;
V V
i Je
>>1 1 >>
( (
) )
⊕ R ⊕ R
if LSB si LSB
1 1
( V (V
i Je
) =1. ) = 1.
⎧ ⎧
⎨ ⎨
⎩ ⎩
4. 4.
Return Z Retourner Z
128 128
. .
The • operation on (pairs of) the 2 L'• opération sur (paires de) la 2
128 128
possible blocks corresponds to the multiplication operation blocs possibles correspond à l'opération de multiplication
for the binary Galois (finite) field of 2 pour la Galois (fini) champ binaire de deux
128 128
elements. éléments. The fixed block, R , determines a Le bloc fixe, R, détermine un
representation of this field as the modular multiplication of binary polynomials of degree less représentation de ce domaine que la multiplication modulaire de polynômes binaires de degré inférieur
than 128. The convention for interpreting strings as polynomials is “little endian”: ie, if u is à 128. La convention pour l'interprétation des chaînes comme des polynômes est "little endian": c'est à dire, si u est
the variable of the polynomial, then the block x la variable du polynôme, le bloc x
0 0
x x
1 1
...x X ...
127 127
corresponds to the polynomial x x correspond au polynôme
0 0
+ x + X
1 1
u + u +
x x
2 2
u u
2 2
+ ... + x + ... + X
127 127
u u
127 127
. . The XOR operation is used to add coefficients of “like” terms during the L'opération XOR est utilisé pour ajouter des coefficients de «comme» des termes au cours de la
multiplication. multiplication. The reduction modulus is the polynomial of degree 128 that corresponds to R || 1. Le module de réduction est le polynôme de degré 128 qui correspond à R || 1.
Ref. [6] discusses this field in detail. Ref. [6] traite de ce domaine en détail.
For a positive integer i , the i th power of a block X with this multiplication operation is denoted Pour un nombre entier positif i, la i-ème puissance d'un bloc X de cette opération de multiplication est noté
X X
i Je
. . For example, H Par exemple, H
2 2
= H • H , H = H • H, H
3 3
= H • H • H , etc. = H • H • H, etc
6.4 GHASH Function 6.4 ghash Fonction
Algorithm 2 below specifies the GHASH function: Algorithme 2 ci-dessous indique la fonction de ghash:
Algorithm 2: GHASH Algorithme 2: ghash
H H
( X ) (X)
Prerequisites : Pré-requis:
block H , the hash subkey. bloc H, la sous-clé de hachage.
Input : Entrée:
bit string X such that len( X ) = 128 m for some positive integer m . chaîne de bits X tel que len (X) = 128 m pour un entier positif m.
Output : Sortie:
block GHASH bloc ghash
H H
( X ). (X).
Steps : Étapes:
1. Let X 1 Soit X
1 1
, X , X
2 2
, ... , X , ..., X
m -1 m -1
, X , X
m m
denote the unique sequence of blocks such that X = X désigner la séquence unique de blocs de telle sorte que X = X
1 1
|| X || X
2 2
|| ||
... || X || ... X
m -1 m -1
|| X || X
m m
. .
2. Let Y 2 Soit Y
0 0
be the “zero block,” 0 le "bloc zéro," 0
128 128
. .
3. For i = 1, ..., m , let Y 3 Pour i = 1, ..., m, permettez-Y
i Je
= ( Y = (Y
i -1 i-1
⊕ X ⊕ X
i Je
) • H . ) • H.
4. Return Y 4. retour Y
m m
. .
In effect, the GHASH function calculates X En effet, la fonction de ghash calcule X
1 1
• H • H
m m
⊕ X ⊕ X
2 2
• H • H
m -1 m -1
⊕ ... ⊕ X ⊕ ... ⊕ X
m -1 m -1
• H • H
2 2
⊕ X ⊕ X
m m
• H . • H. Ref. [6] Ref. [6]
describes methods for optimizing implementations of GHASH in both hardware and software. décrit des méthodes pour optimiser les implémentations de ghash à la fois matériel et logiciel.
The GHASH function is illustrated in F igure 1 below, without the zero block, Y La fonction de ghash est illustré en F igure 1 ci-dessous, sans le bloc zéro, Y
0 0
, whose , Dont
exclusive-OR with X OU exclusif avec X
1 1
does not change X ne change pas X
1 1
. .

Page 21 Page 21
NIST Special Publication 800-38D NIST Special Publication 800-38D
Figure 1: GHASH Figure 1: ghash
H H
( X (X
1 1
|| X || X
2 2
|| ... || X || ... || X
m m
) = Y ) = Y
m m
. .
6.5 GCTR Function 6.5 GCTR Fonction
Algorithm 3 below specifies the GCTR function. Algorithme 3 ci-dessous indique la fonction de GCTR. The suggested notation does not indicate the La notation proposée n'indique pas le
choice of the underlying block cipher. choix de l'algorithme de chiffrement par bloc sous-jacent.
Algorithm 3: GCTR Algorithme 3: GCTR
K K
( ICB , X ) (AOI, X)
Prerequisites : Pré-requis:
approved block cipher CIPH with a 128-bit block size; approuvé ICPC de chiffrement par blocs avec une taille de bloc de 128 bits;
key K . clé K.
Input : Entrée:
initial counter block ICB ; ICB initiale de bloc compteur;
bit string X , of arbitrary length. chaîne de bits X, de longueur arbitraire.
Output : Sortie:
bit string Y of bit length len( X ). Y chaîne de bits de longueur de bits len (X).
Steps : Étapes:
1. If X is the empty string, then return the empty string as Y . 1 Si X est une chaîne vide, puis retourner la chaîne vide comme Y.
2. Let 2 Soit
( ) ()
⎡ ⎡
⎤ ⎤
128 128
len X len X
n = n =
. .
3. Let X 3 Soit X
1 1
, X , X
2 2
, ... , X , ..., X
n -1 n-1
, X , X
n n
* *
denote the unique sequence of bit strings such that désigner la séquence unique de chaînes de bits de telle sorte que
∗ *
− -
= =
n n
n n
X X
X X
X X
X X
X X
|| ||
|| ||
... ...
|| ||
|| ||
1 1
2 2
1 1
; ;
X X
1 1
, X , X
2 2
,..., X , ..., X
n -1 n-1
are complete blocks. sont des blocs complets.
2 2
4. Let 4 Soit
ICB ICB
CB = CB =
1 1
. .
5. For i = 2 to n , let CB 5 Pour i = 2 à n, soit CB
i Je
= inc = Inc
32 32
( CB (CB
i -1 i-1
). ).
6. For 6.
( ) ()
i Je
K K
i Je
i Je
CB CB
X X
Y Y
n n
i Je
CIPH ICPC
let laisser
,1 , 1
to à
1 1
⊕ ⊕
= =
− -
= =
. .
7. Let Soit 7
( ) ()
( ) ()
( (
) )
n n
K K
X X
n n
CB CB
X X
Y Y
n n
n n
CIPH ICPC
MSB MSB
len len
∗ *
⊕ ⊕
= =
∗ *
∗ *
. .
... ...
X X
X X
X X
1 1
• •
m m
2 2
2 2
Consequently, X Par conséquent, X
n n
* *
is either a complete block or a nonempty partial block, and if 1 ≤ len( X ) ≤128, then X = X est soit un bloc entier ou un bloc partiel non vide, et si 1 ≤ len (X) ≤128, alors X = X
1 1
* *
. .
H H
Y Y
1 1
⊕ ⊕
⊕ ⊕
•H • H
Y Y
2 2
•H • H
Y Y
m m
13 13

Page 22 Page 22
NIST Special Publication 800-38D NIST Special Publication 800-38D
8. Let 8 Soit
∗ *
. .
= =
n n
Y Y
Y Y
Y Y
Y Y
|| ||
... ...
|| ||
|| ||
2 2
1 1
9. Return Y . 9 Retour Y.
In Steps 1 and 2, the input string of arbitrary length is partitioned into a sequence of blocks to the Aux étapes 1 et 2, la chaîne d'entrée de longueur arbitraire est divisée en une séquence de blocs à l'
greatest extent possible, so that only the rightmost string in the sequence may be a “partial” la mesure du possible, de sorte que seule la chaîne la plus à droite dans la séquence peut être "partielle"
block. bloc. In Steps 3 and 4, the 32-bit incrementing function is iterated on the initial counter block Aux étapes 3 et 4, la fonction d'incrémentation à 32 bits est itéré sur le bloc d'initialisation
input to generate a sequence of counter blocks; entrée pour générer une séquence de blocs de comptage; the input block is the first block of the sequence. le bloc d'entrée est le premier bloc de la séquence.
In Steps 5 and 6, the block cipher is applied to the counter blocks and the results are XORed with Dans les étapes 5 et 6, le bloc de chiffrement est appliqué sur le compteur de blocs et les résultats sont XORed avec
the corresponding blocks (or partial block) of the partition of the input string. les blocs correspondants (ou bloc partiel) de la partition de la chaîne d'entrée. In Step 7, the À l'étape 7, le
sequence of results is concatenated to form the output. séquence de résultats est concaténée pour former la sortie.
Figure 2 below illustrates the GCTR function. Figure 2 ci-dessous illustre la fonction de GCTR.
CIPH ICPC
K K
⊕ ⊕
X X
2 2
Y Y
2 2
CIPH ICPC
K K
CB CB
n -1 n-1
⊕ ⊕
X X
n -1 n-1
Y Y
n -1 n-1
CIPH ICPC
K K
⊕ ⊕
X X
n n
* *
Y Y
n n
* *
ICB ICB
CIPH ICPC
K K
⊕ ⊕
X X
1 1
Y Y
1 1
inc inc
… ...
… ...
CB CB
2 2
CB CB
n n
inc inc
Figure 2: GCTR Figure 2: GCTR
K K
( ICB , X (AOI, X
1 1
|| X || X
2 2
|| ... || X || ... || X
n n
* *
) = Y ) = Y
1 1
|| Y || Y
2 2
|| ... || Y || ... || Y
n n
* *
. .
7 GCM Specification 7 GCM Spécification
Algorithms 4 and 5 for the authenticated encryption and authenticated decryption functions of Algorithmes 4 et 5 pour le chiffrement authentifié et fonctions de décryptage authentifiées
GCM are specified in Secs. GCM sont exprimées en Secs. 7 .1 a nd 7.2 below. 7 .1 e 7.2 ci-dessous. The specifications include the inputs, the outputs, Les spécifications comprennent les entrées, les sorties,
the steps of the algorithm, diagrams, and summaries. les étapes de l'algorithme, des diagrammes et des résumés. The suggested notation does not indicate La notation proposée n'indique pas
the choice of the underlying block cipher. le choix de l'algorithme de chiffrement par bloc sous-jacent. The inputs that are typically fixed across many Les entrées qui sont généralement fixés sur un grand nombre
invocations of the function are called the prerequisites; invocations de la fonction sont appelés les conditions préalables; however, some of the prerequisites may Cependant, certaines des conditions peut
also be regarded as (varying) input. également être considéré comme (variant) d'entrée. The prerequisites and the other inputs shall meet the Les conditions préalables et les autres intrants doit répondre à la
requirements in Sec. 5. exigences Sec. 5.
For both algorithms, equivalent sets of steps that produce the correct output are permitted. Pour les deux algorithmes, des ensembles équivalents de mesures qui produisent la sortie correcte sont autorisés. For Pour
example, in Algorithm 5, the verification of the tag may precede the computation of the Ainsi, dans l'algorithme 5, la vérification de l'étiquette peut précéder le calcul de l'
plaintext. clair.
7.1 Algorithm for the Authenticated Encryption Function 7.1 Algorithme pour la fonction de chiffrement authentifié
Algorithm 4 below specifies the authenticated encryption function: Algorithme 4 ci-dessous indique la fonction de chiffrement authentifié:
14 14

Page 23 Page 23
NIST Special Publication 800-38D NIST Special Publication 800-38D
Algorithm 4: GCM-AE Algorithme 4: GCM-AE
K K
( IV , P , A ) (IV, P, A)
Prerequisites : Pré-requis:
approved block cipher CIPH with a 128-bit block size; approuvé ICPC de chiffrement par blocs avec une taille de bloc de 128 bits;
key K ; clé K;
definitions of supported input-output lengths;
supported tag length t associated with the key.
Input :
initialization vector IV (whose length is supported);
plaintext P (whose length is supported);
additional authenticated data A (whose length is supported).
Output :
ciphertext C ;
authentication tag T .
Steps : Étapes:
1. Let H = CIPH
K K
( 0
128 128
). ).
2. Define a block, J
0 0
, as follows:
If len( IV )=96, then let J
0 0
= IV || 0
31 31
||1.
If len( IV ) ≠ 96, then let s = 128 ⎡len( IV )/128⎤-len( IV ), and let
J J
0 0
=GHASH
H H
( IV ||0
s +64
||[len( IV )]
64 64
). ).
3. Let C =GCTR
K K
(inc
32 32
( J
0 0
), P ).
4. Let
( ) ()
⎡
⎤
( ) ()
C C
C C
u u
len len
128 128
len len
128 128
− -
⋅
= =
and let
( ) ()
⎡
⎤
( ) ()
A A
A A
v v
len len
128 128
len len
128 128
− -
⋅
= =
. .
5. Define a block, S , as follows:
S = GHASH
H H
( A || 0
v v
|| C || 0
u u
|| [len( A )]
64 64
|| [len( C )]
64 64
). ).
6. Let
( (
) )
S S
J J
T T
K K
, ,
0 0
. .
( (
) )
t t
GCTR
MSB MSB
= =
7. Return ( C , T ).
In Step 1, the hash subkey for the GHASH function is generated by applying the block cipher to
the “zero” block. In Step 2, the pre-counter block ( J
0 0
) is generated from the IV. In particular, En particulier,
when the length of the IV is 96 bits, then the padding string 0
31 31
||1 is appended to the IV to form
the pre-counter block. Otherwise, the IV is padded with the minimum number of '0' bits,
possibly none, so that the length of the resulting string is a multiple of 128 bits (the block size);
this string in turn is appended with 64 additional '0' bits, followed by the 64-bit representation of
the length of the IV, and the GHASH function is applied to the resulting string to form the pre-
counter block. In Step 3, the 32-bit incrementing function is applied to the pre-counter block to
produce the initial counter block for an invocation of the GCTR function on the plaintext. The La
output of this invocation of the GCTR function is the ciphertext.
In Steps 4 and 5, the AAD and the ciphertext are each appended with the minimum number of
' 0 ' bits, possibly none, so that the bit lengths of the resulting strings are multiples of the block
size. The concatenation of these strings is appended with the 64-bit representations of the
lengths of the AAD and the ciphertext, and the GHASH function is applied to the result to
produce a single output block. In Step 6, this output block is encrypted using the GCTR function
15 15

Page 24 Page 24
NIST Special Publication 800-38D
with the pre-counter block that was generated in Step 2, and the result is truncated to the
specified tag length to form the authentication tag. The ciphertext and the tag are returned as the
output in Step 7.
P P
C C
A A
GHASH
H H
0 0
v v
0 0
u u
[len( A )]
64 64
[len( C )]
64 64
CIPH
K K
J J
0 0
GCTR
K K
GCTR
K K
MSB MSB
t t
H H
inc
32 32
0 0
128 128
T T
IV IV
Figure 3: GCM-AE
K K
( IV , P , A ) = ( C , T ).
The authenticated encryption function is illustrated in Figure 3 above. The determination of J
0 0
from IV (Step 2) is not depicted.
7.2 Algorithm for the Authenticated Decryption Function
Algorithm 5 below specifies the authenticated decryption function:
Algorithm 5: GCM-AD
K K
( IV , C , A , T )
Prerequisites :
approved block cipher CIPH with a 128-bit block size;
key K ;
definitions of supported input-output lengths;
supported tag length t associated with the key.
Input :
initialization vector IV ;
ciphertext C ;
16 16

Page 25 Page 25
NIST Special Publication 800-38D
additional authenticated data A ;
authentication tag T .
Output :
plaintext P or indication of inauthenticity FAIL .
Steps : Étapes:
1. If the bit lengths of IV , A or C are not supported, or if len( T ) ≠ t , then return FAIL.
2. Let H = CIPH
K K
( 0
128 128
). ).
3. Define a block, J
0 0
, as follows:
If len( IV )=96, then J
0 0
= IV || 0
31 31
||1.
If len( IV ) ≠ 96, then let s = 128 ⎡len( IV )/128⎤-len( IV ), and
J J
0 0
=GHASH
H H
( IV ||0
s +64
||[len( IV )]
64 64
). ).
4. Let P =GCTR
K K
(inc
32 32
( J
0 0
), C ).
5. Let
( ) ()
⎡
⎤
( ) ()
C C
C C
u u
len len
128 128
len len
128 128
− -
⋅
= =
and let
( ) ()
⎡
⎤
( ) ()
A A
A A
v v
len len
128 128
len len
128 128
− -
⋅
= =
. .
6. Define a block, S , as follows:
S = GHASH
H H
( A || 0
v v
|| C || 0
u u
|| [len( A )]
64 64
|| [len( C )]
64 64
) )
7. Let
( (
) )
. .
( (
) )
S S
J J
T T
K K
t t
, ,
GCTR
MSB MSB
0 0
=′
8. If
T T
T T
′ »
= , then return P ; else return FAIL .
In Step 1, the implementation's support for the lengths of the IV, the ciphertext, the AAD, and
the authentication tag is verified. In Step 2, the hash subkey for the GHASH function is
generated by applying the block cipher to the “zero” block. In Step 3, the pre-counter block ( J
0 0
) )
is formed as for the authenticated encryption function (Step 2 of Section 7 .1) . In Step 4, the 32-
bit incrementing function is applied to the pre-counter block to produce the initial counter block
for an invocation of the GCTR function on the ciphertext. The output of this invocation of the
GCTR function is the plaintext that corresponds to the ciphertext for the given IV.
In Steps 5 and 6, the AAD and the ciphertext are each appended with the minimum number of
' 0 ' bits, possibly none, so that the bit lengths of the resulting strings are multiples of the block
size. The concatenation of these strings is appended with 64-bit representations of the lengths of
the AAD and the ciphertext, and the GHASH function is applied to the result to produce a single
output block. In Step 7, this output block is encrypted using the GCTR function with the pre-
counter block that was generated in Step 3, and the result is truncated to the specified tag length
to form the authentication tag. In Step 8, the result of Step 7 is compared with the authentication
tag that was received as an input: if they are identical, then the plaintext is returned; otherwise,
FAIL is returned.
Equivalent sets of steps that produce the correct output are permitted. In particular, the En particulier, l'
verification of the tag may precede the computation of the plaintext.
The authenticated decryption function is illustrated in Figure 4 below. The determination of J
0 0
from IV (Step 3) is not depicted.
17 17

Page 26 Page 26
NIST Special Publication 800-38D
P P
C C
A A
GHASH
H H
0 0
v v
0 0
u u
[len( A )]
64 64
[len( C )]
64 64
inc
32 32
CIPH
K K
J J
0 0
GCTR
K K
GCTR
K K
MSB MSB
t t
0 0
128 128
H H
T T
′ »
if ≠
FAIL
T T
IV IV
Figure 4: GCM-AD
K K
( IV , C , A , T ) = P or FAIL .
8 Uniqueness Requirement on IVs and Keys
The IVs in GCM must fulfill the following “uniqueness” requirement:
The probability that the authenticated encryption function ever will be invoked with the
same IV and the same key on two (or more) distinct sets of input data shall be no greater
than 2
-32
. .
Compliance with this requirement is crucial to the security of GCM. Across all instances of the
authenticated encryption function with a given key, if even one IV is ever repeated, then the
implementation may be vulnerable to the forgery attacks that are described in Ref [5 ] and
summarized in Appendix A. In practice, this requirement is almost as important as the secrecy
of the key.
The role of key establishment in supporting this requirement is discussed in Sec. 8.1 . The two Les deux
allowed IV constructions for satisfying this requirement are given in Sec. 8 .2. Constraints on the
number of invocations of the authenticated encryption function are given in Sec. 8.3. 8.3.
18 18

Page 27 Page 27
NIST Special Publication 800-38D
8.1 Key Establishment
The following requirement, which is the norm for secret key cryptographic algorithms in general,
takes on explicit importance for GCM to support the uniqueness requirement in Sec. 8:
Any GCM key that is established among its intended users shall, with high probability, be
fresh.
In practice, the requirements in Sec. 5.1 should ensure that a key is fresh when it is generated, if
the generation mechanism is resistant to tampering. Achieving such resistance usually imposes
requirements on the management of the key generation mechanism.
In particular, if the key generation mechanism is deterministic, then the management of the
mechanism shall provide strong assurance that no outside entity can induce the repetition of a
previous set of inputs to the mechanism, or otherwise cause the repetition of a previous output.
For example, GCM keys may be established using the key derivation functions of the following
protocols as allowed in [9 ]: Transport Layer Security, Internet Key Exchange v1 and v2, and
Secure Shell.
Similarly, if a new key must be transported to its intended recipient(s), the method of
transport/distribution shall provide strong assurance against “replay,” so that no party can induce
the substitution of a previous key for the intended key.
GCM keys should be established within the framework of an approved key management
structure to assure their freshness, as well as their confidentiality and authenticity; the details of
such structures are outside the scope of this Recommendation.
8.2 IV Constructions
This Recommendation provides two frameworks for constructing IVs. The first construction,
described in Sec. 8.2.1 , relies on deterministic elements to achieve the uniqueness requirement in
Sec. 8 ; the second construction, described in Sec. 8.2.2, relies on a sufficiently long output string
from an approved RBG with a sufficient security strength.
For any supported IV length that is strictly less than 96 bits, the construction in Sec. 8 .2.1, shall
be used, across all instances of the authenticated encryption function with the given key.
For any supported IV length that is 96 bits or greater, exactly one of the constructions, but not
both, shall be used, across all instances of the authenticated encryption function with the given
key. clé.
For example, suppose that an implementation supports IV lengths of 64 bits, 96 bits, 128 bits,
and 160 bits. For 64-bit IVs the only choice is the construction in Sec. 8 .2.1. For the other three
IV lengths, one possible combination of choices is the construction in Sec. 8 .2.1 for 96-bit IVs
and the construction in Sec. 8.2.2 for 128-bit and 160-bit IVs.
19 19

Page 28 Page 28
NIST Special Publication 800-38D
8.2.1 Deterministic Construction
In the deterministic construction, the IV is the concatenation of two fields, called the fixed field
and the invocation field. The fixed field shall identify the device, or, more generally, the context
for the instance of the authenticated encryption function. The invocation field shall identify the
sets of inputs to the authenticated encryption function in that particular device.
For any given key, no two distinct devices shall share the same fixed field, and no two distinct
sets of inputs to any single device shall share the same invocation field. Compliance with these
two requirements implies compliance with the uniqueness requirement on IVs in Sec. 8 .
If desired, the fixed field itself may be constructed from two or more smaller fields. Moreover, De plus,
one of those smaller fields could consist of bits that are arbitrary (ie, not necessarily
deterministic nor unique to the device), as long as the remaining bits ensure that the fixed field is
not repeated in its entirety for some other device with the same key.
Similarly, the entire fixed field may consist of arbitrary bits when there is only one context to
identify, such as when a fresh key is limited to a single session of a communications protocol. In Dans
this case, if different participants in the session share a common fixed field, then the protocol
shall ensure that the invocation fields are distinct for distinct data inputs.
The invocation field typically is either 1) an integer counter or 2) a linear feedback shift register
that is driven by a primitive polynomial to ensure a maximal cycle length. In either case, the
invocation field increments upon each invocation of the authenticated encryption function.
The lengths and positions of the fixed field and the invocation field shall be fixed for each
supported IV length for the life of the key. In order to promote interoperability for the default IV
length of 96 bits, this Recommendation suggests, but does not require, that the leading (ie,
leftmost) 32 bits of the IV hold the fixed field; and that the trailing (ie, rightmost) 64 bits hold
the invocation field.
8.2.2 RBG-based Construction
In the RBG-based construction, the IV is the concatenation of two fields, called the random field
and the free field. For each IV length that is supported by the implementation and used with the
RBG-based construction, the lengths of these fields shall be fixed for the life of the key.
Moreover, the length of the random field shall be at least 96 bits; the free field may be empty.
If i is a supported IV length that is associated to the RBG-based construction, then let r ( i ) denote
the bit length of the random field. The random field shall either consist of 1) an output string of
r ( i ) bits from an approved RBG with a sufficient security strength, or 2) the result of applying the
r ( i )–bit incrementing function to the random field of the preceding IV for the given key. The La
r ( i )–bit output string from the RBG is called a direct random string, and the random fields that
result from applying the r ( i )–bit incrementing function are called its successors.
20 20

Page 29 Page 29
NIST Special Publication 800-38D
There are no requirements on the bits in the free field. For example, they may identify the
device, similar to the fixed field of the deterministic construction, except within the RBG-based
construction these identifiers are not required to be distinct for each device. For any IV length
that is associated to the RBG-construction, the free field is recommended to be empty, so that the
random field is the entire IV .
The instantiations of the RBGs in any two distinct devices shall be independent, so that the
distribution of direct random strings across all of the RBG instantiations is expected to be
uniform. For example, if the initialization of the RBG instantiations depends only on a secret
seed, then each instantiation shall be initialized with a distinct seed.
8.3 Constraints on the Number of Invocations
The following requirement applies to all implementations that use either 1) the deterministic
construction with IVs whose length is not 96, or 2) the RBG-based construction, for IVs of any
length. longueur. In other words, unless an implementation only uses 96-bit IVs that are generated by the
deterministic construction:
The total number of invocations of the authenticated encryption function shall not exceed
2 2
32 32
, including all IV lengths and all instances of the authenticated encryption function with
the given key.
This is a “global” requirement that can be achieved by appropriate “local” limits on each
instance of the authenticated encryption function with a given key. For example, suppose an
implementation consists of 2
10 10
devices that only support 64-bit, 96-bit, and 128-bit IVs. One Un
way to satisfy the above requirement would be to limit each device to 2
20 20
invocations with 64-bit
IVs, 2
21 21
invocations with 96-bit IVs, and 2
20 20
invocations with 128-bit IVs.
For the RBG-based construction of IVs, the above requirement, in conjunction with the
requirement that r ( i )≥96, is sufficient to ensure the uniqueness requirement in Sec. 8, as follows
from the discussion in Ref. [ 4].
For the deterministic construction, the lengths of the two fields imply two additional operational
constraints. contraintes. These constraints apply to any supported IV length, including 96 bits:
• The bit length of the invocation field limits the number of invocations of the
authenticated encryption function with any given fixed field and key. In particular, if s
denotes the number of bits in the invocation field, then the authenticated encryption
function cannot be invoked on more than 2
s s
distinct input sets without violating the
uniqueness requirement.
• Similarly, an s -bit fixed field implies a limit of 2
s s
on the number of distinct
devices/contexts that can implement the authenticated encryption function for the given
key, with IVs of the given length.
21 21

Page 30 Page 30
NIST Special Publication 800-38D
9 Practical Considerations for Validating Implementations
Both the designer of a GCM implementation and the information technology (IT) professional
who deploys and maintains it within a particular system have important roles in meeting the
uniqueness requirement in Sec. 8, as discussed in Secs. 9.1 and 9.2 below.
The additional requirements in these two sections are provided for the purpose of demonstrating
compliance with the uniqueness requirement in Sec. 8 w ithin a validation program. Specifically, Plus précisément,
analogous to the requirements in Ref. [9] , the requirements in these two sections apply to
implementations that are validated against the requirements of FIPS Pub. 140-2 (Ref. [ 3]) , or any
superseding version of FIPS 140.
Implementations that are not validated against the requirements of FIPS Pub. 140-2 may interpret
the requirements in Secs. 9. 1 and 9.2 as recommendations.
9.1 Design Considerations
In order to inhibit an unauthorized party from controlling or influencing the generation of IVs,
GCM shall be implemented only within a cryptographic module that meets the requirements of
FIPS Pub. 140-2. In particular, the cryptographic boundary of the module shall contain a
“generation unit” that produces IVs according to one of the constructions in Sec. 8.2 above.
The documentation of the module for its validation against the requirements of FIPS 140-2 shall
describe how the module complies with the uniqueness requirement on IVs. At a minimum, the
documentation shall address the considerations in this section, and clearly document the
responsibilities of the IT professional who configures, deploys, and maintains the GCM
implementations within a larger system.
The following are three important design considerations for GCM modules:
1. The freshness of keys shall be assured, as discussed in Sec. 8 .1.
2. The IV shall be a critical security parameter as defined in FIPS Pub. 140-2 until the
authenticated encryption function is invoked with the IV. Prior to this invocation, the IV
shall be provided the same protection as other critical security parameters in a module
that is validated to the requirements in FIPS Pub. 140-2.
3. A loss of power to the module shall not cause the repetition of IVs. If the generation unit
cannot recover from a loss of power, then the authenticated encryption function shall
enter a failure state until a fresh key can be established.
The IV construction that is implemented from Sec. 8 .2 above affects the options for recovery
from a loss of power. For the deterministic construction, all of the deterministic elements that
are necessary to construct the IV would have to be available when power is restored. For Pour
example, these elements could be stored in non-volatile memory.
22 22

Page 31 Page 31
NIST Special Publication 800-38D
When power is restored, neither the preceding IV nor any other previous IV shall immediately be
repeated for the key. One way to avoid such a repetition would be to ensure that the invocation
field value that is periodically stored in the non-volatile memory is always one or more values
ahead of the operational value in the sequence.
One potential advantage of the RBG-based construction is that the RBG may be designed to
recover from a loss of power in a straightforward manner, ie, without requiring action from the
IT professional that maintains the system. For example, the RBG may incorporate a non-
deterministic source of bits that would automatically be available to the RBG when power is
restored.
Alternatively, the entire state of the RBG may be stored periodically in non-volatile memory. In Dans
this case, similar to the deterministic construction, when power is restored, the design shall
ensure that the RBG shall not output strings for use within new IVs until the state of the RBG is
advanced beyond the state that generated the last IV for the key. In other words, the direct
random string for the first new IV shall be, with high probability, different than the direct
random string in any IV that was generated before the loss of power.
Even if the process is not automatic, the IT professional who maintains the system may simply
reinitialize the RBG when power is restored, for example, with a fresh seed. In this case, either
the design of the module or the IT professional that maintains the system shall ensure that
compliance is maintained with the independence condition on the RBGs in Sec. 8 .2.2.
9.2 Operational Considerations
Compliance with the uniqueness requirement on IVs, and hence the security of GCM, ultimately
depends on the IT professional who configures, deploys, and maintains the GCM modules within
a particular system. The documentation for a GCM module shall give the IT professional
detailed instructions that are tailored to the particular design of the module.
The following are some typical operational considerations for the uniqueness requirement:
• Is the configuration of any GCM module, or any operational value, vulnerable to control
or influence from any unauthorized party?
• For any given key, how are configuration choices enforced across all modules that ever
implement the authenticated encryption function?
• How is the freshness of keys assured, as discussed in Sec. 8.1 ?
• If an implementation does not exclusively use 96-bit IVs that are generated by the
deterministic construction, how is the requirement in Sec 8. 3 on the number of
invocations ensured?
• As discussed in Sec. 9 .1, how does IV generation within the modules recover from a loss
of power without violating the uniqueness requirement on IVs?
23 23

Page 32 Page 32
NIST Special Publication 800-38D
24 24
The following considerations are specific to the deterministic construction:
• How are the device identifiers installed into the fixed field so that compliance with the
requirements on the fixed field in Sec. 8 .2.1 is ensured, both for the initially deployed
modules and for any subsequent deployed modules?
• Is the length of the invocation field sufficient to support all of the invocations that can
occur in any module during the lifetime of any key, as discussed in the first bullet in Sec.
8.3 ?
• For any given key and IV length, is the length of the fixed field sufficient to support the
number of modules that will implement authenticated encryption, as discussed in the
second bullet in Sec. 8.3 ?
• If the default setting for the lengths of the fixed field and the invocation field can be
altered, then how is the choice enforced across all modules with any given key?
The following consideration is specific to the RBG-based construction:
• How are the RBGs for IV generation initialized so that compliance is ensured with the
independence requirement in Sec. 8 .2.2, for the initially deployed modules and for any
subsequent deployed modules?
10 Conformance
The two categories of implementations that may claim conformance with this Recommendation
are GCM and GMAC.
Implementations may restrict the bit lengths of the plaintext, AAD, IVs, and authentication tags
that it supports, as discussed in Secs. 5.2.1. 1 and 5.2.1.2 above. Although such restrictions may
affect interoperability, only the elimination of the plaintext altogether, ie, GMAC, is considered
as a distinct category of implementation.
For every algorithm that is specified in this Recommendation, a conforming implementation may
replace the given set of steps with any mathematically equivalent sets of steps. In other words, En d'autres termes,
different procedures that produce the correct output for any input are permitted.

Page 33 Page 33
NIST Special Publication 800-38D
Appendix A: Importance of the Uniqueness Requirement on IVs
Sec. 8 contains a uniqueness requirement for the IVs of GCM, across all implementations of the
authenticated encryption function with any given key. This appendix summarizes why this
requirement is crucial to the security of GCM, as first described in Ref. [ 5].
The secure operation of a cryptographic algorithm depends not only on the proper
implementation of the steps of the algorithm, but also on the adherence to the associated
requirements. exigences. An obvious example for any symmetric key algorithm is that the key needs to be
kept secret. For GCM, the requirement in Sec. 5 .2.1 for the uniqueness of the IVs is almost as
important, although not as obvious.
Consider first the example of the Counter mode requirement in Ref. [ 10] for the counter blocks
to be unique. If this requirement is breached, then the Counter mode encryption function may
fail to provide the expected confidentiality for the data blocks that correspond to the repeating
counter blocks, although the other data blocks are not affected.
The Counter mode decryption function has a vulnerability that is arguably more serious.
Counter-mode ciphertext is “malleable” in the sense that flipping any of its bits will induce the
corresponding bits of the plaintext to flip upon decryption. Therefore, if an adversary knows a
plaintext-ciphertext pair and can induce the decryption function to use the counter blocks from
the known pair, then, by choosing which bits to flip in the known ciphertext, the adversary can
control the result of decryption, up to the length of the known plaintext.
This vulnerability motivates combining the Counter mode encryption mechanism with an
authentication mechanism, such as occurs in GCM. The idea is to prevent the adversary’s
altered ciphertext from being accepted as valid. However, as detailed in Ref. [ 5], the
authentication assurance in GCM crucially depends on the uniqueness of the IVs.
In particular, if IVs are ever repeated for the GCM authenticated encryption function for a given
key, then it is likely that an adversary will be able to determine the hash subkey from the
resulting ciphertexts. The adversary then could easily construct a ciphertext forgery. In Dans
particular, given the ciphertext and tag outputs for an invocation of the authenticated encryption
function, along with the associated IV and AAD inputs, the adversary could substitute any
ciphertext and AAD strings and use the subkey to generate the valid substitute tag. Although Bien que
this forgery would use the same IV, in most cases it will not be feasible for the authenticated
decryption function to detect the repetition. Thus, the authentication assurance essentially is lost.
Worse, the loss of authentication means that GCM inherits the problematic malleability of its
Counter mode ciphertext. In the above scenario, knowing the original plaintext that corresponds
to the given ciphertext, the adversary can construct the substitute ciphertext in such a way as to
correspond to any desired plaintext of the same length. In other words, the adversary essentially
could control the plaintext output of the authenticated decryption function.
25 25

Page 34 Page 34
NIST Special Publication 800-38D
Appendix B: Authentication Assurance
The creation of an authentication tag by the authenticated encryption function provides the
mechanism whereby assurance of the authenticity of the plaintext and AAD (and IV) can be
obtained upon the execution of the authenticated decryption function. The nature of this
assurance depends on the output of the authenticated decryption function:
• If the output is the plaintext, then the design of the mode provides strong, but not
absolute, assurance that the purported source of the data created the tag, ie, that the
plaintext and the AAD (and the IV and the tag) are authentic. Consequently, the mode
also provides strong assurance that this information was not subsequently altered, either
intentionally or unintentionally.
• If the output is FAIL , then it is certain that at least one of the given inputs (ie, the
ciphertext, the AAD, the IV, or the tag) is not authentic.
In the first case, the assurance is not absolute because forgeries are possible, in principle. In Dans
other words, an adversary, ie, a party without access to the key or to the authenticated
encryption function, may be able to produce the correct tag for some triple of ciphertext, AAD,
and IV.
As with any tag-based authentication mechanism, if the adversary chooses a t -bit tag at random,
it is expected to be correct for given data with probability 1/2
t t
. . With GCM, however, an
adversary can choose tags that increase this probability, proportional to the total length of the
ciphertext and AAD. Consequently, GCM is not well-suited for use with short tag lengths or
very long messages.
In particular, if n denotes the total number of blocks in the encoding (ie, the input to the
GHASH function in the definition of S in Secs. 7. 1 and 7.2 above) of the ciphertext and AAD,
then there is a method of constructing a “targeted” ciphertext forgery that is expected to succeed
with a probability of approximately n /2
t t
. . Moreover, each successful forgery in this attack 1)
increases the probability that subsequent targeted forgeries will succeed, and 2) leaks
information about the hash subkey, H . Eventually, H may be compromised entirely, with
consequences as described at the end of Appendix A: the authentication assurance is completely
lost. perdu.
Ref. [1] describes the attack, and Ref. [7] gives a detailed treatment of the security properties of
GCM. Appendix C gives guidance and requirements for the use of the two shortest tags sizes, 32
and 64 bits.
Independent of this attack, an adversary may attempt to systematically guess many different tags
for a given input to authenticated decryption, and thereby increase the probability that one (or
more) of them, eventually, will be accepted as valid. For this reason, the system or protocol that
implements GCM should monitor and, if necessary, limit the number of unsuccessful verification
attempts for each key.
26 26

Page 35 Page 35
NIST Special Publication 800-38D
Moreover, as with most block cipher modes of operation, the security assurance of GCM
degrades as more data is processed with a single key. Therefore, the total number of blocks of
plaintext and AAD that are protected by invocations of the authenticated encryption function
during the lifetime of the key should be limited. A reasonable limit for most applications would
be 2
64 64
, consistent with the requirement on the number of invocations in Sec. 8 .3.
27 27

Page 36 Page 36
NIST Special Publication 800-38D
Appendix C: Requirements and Guidelines for Using Short Tags
For some voice or video applications, short authentication tags can be appropriate. The forgery
of some fraction of the individual authenticated “packets” may be tolerable, because each packet
of data in a large stream may carry very little of the overall meaning.
However, even for voice and video applications, short tags can be problematic for GCM, due to
the targeted forgery attack that is summarized in Appendix B and detailed in Ref. [1] . Absent Absent
the requirements and guidelines in this appendix, it may be practical for the attack to produce the
hash subkey, H , after which the authentication assurance is completely lost. Nevertheless, this Néanmoins, cette
Recommendation does not preclude short tags entirely, because knowledgeable security
professionals should be able to manage the risks in connection with this attack, and its potential
improvement. amélioration.
The following guidelines implicitly describe the special circumstances that may be appropriate
for short tags. A packet in this context is a set of inputs to the authenticated decryption function.
1. Packets that fail the integrity check within the authenticated decryption function should
be silently discarded. In other words, the controlling protocol/system over which packets
are received should not provide an ACK/NACK response regarding the integrity of
individual packets. However, the receiver should log authentication errors internally—in
a way which is undetectable from side-channel information—and terminate the
connection or notify the user if the percentage of errors exceeds what would be
considered normal. This is standard security practice with any protocol/system and any
algorithm choice.
2. The AAD within packets should be limited to the necessary header information and
should not contain messages to be authenticated along with the encrypted data.
3. The substance or meaning of the overall message that is comprised of a large number of
packets should not be lost or compromised by the forgery of a single, arbitrary packet.
For example, packets could carry a sequence of snippets of voice or visual data, but an
individual packet should not carry a .txt or .doc file. Ideally, the plaintext data
underlying the encryption should not be so stereotypical as to be guessable.
4. The controlling protocol/system should establish a new GCM key—and thus a new hash
subkey, H —frequently, depending on the maximum combined length of the ciphertext
and AAD that can occur within a single packet. Moreover, for 32-bit tags, this combined
length should be very small—on the order of tens or hundreds of bytes; 64-bit tags extend
the maximum combined length into the millions of bytes.
An example of a protocol that meets these guidelines is Secure Real-time Transport Protocol
carrying Voice over Internet Protocol, running over User Datagram Protocol.
28 28

Page 37 Page 37
NIST Special Publication 800-38D
Tables 1 and 2 below quantify the recommendations in Item 4 above, for 32-bit and 64-bit tags,
respectively. respectivement. Each row has two entries: 1) a maximum combined length for the ciphertext and
the AAD in a single packet, in bytes, and 2) a corresponding maximum number of invocations of
the authenticated decryption function, across all instances of the GCM with the given key.
For any implementation that supports 32-bit or 64-bit tags, one of the rows in Table 1 or Table 2,
respectively, shall be enforced. In particular, the supported lengths for the plaintext/ciphertext
and the AAD shall ensure that every valid packet satisfies the length restriction in the row, and
the controlling protocol/system shall ensure that the key is changed before the authenticated
decryption function is invoked more than the maximum that is given in the row. A smaller
maximum may also be enforced.
Table 1: Constraints with 32-bit Tags
Maximum Combined Length
of the Ciphertext and AAD
In a Single Packet (bytes)
Maximum Invocations of the
Authenticated Decryption Function
2 2
5 5
2 2
22 22
2 2
6 6
2 2
20 20
2 2
7 7
2 2
18 18
2 2
8 8
2 2
15 15
2 2
9 9
2 2
13 13
2 2
10 10
2 2
11 11
Table 2: Constraints with 64-bit Tags
Maximum Combined Length
of the Ciphertext and AAD
In a Single Packet (bytes)
Maximum Invocations of the
Authenticated Decryption Function
2 2
15 15
2 2
32 32
2 2
17 17
2 2
29 29
2 2
19 19
2 2
26 26
2 2
21 21
2 2
23 23
2 2
23 23
2 2
20 20
2 2
25 25
2 2
17 17
29 29

Page 38 Page 38
NIST Special Publication 800-38D
Appendix D: Protection Against Replay of Messages
As described in Appendix B, the successful verification of the tag within the authenticated
decryption function gives assurance of the authenticity of the data; however, the party that
presents the input data to the authenticated decryption function may not be the original source of
the plaintext and AAD. In other words, GCM, like many other authentication mechanisms, does
not inherently prevent an adversary from intercepting the output of an invocation of
authenticated encryption and “replaying” it for authenticated decryption at a later time, for
example, in an attempt to impersonate a party that has access to the key. In some protocols an
adversary may even be able to use data that the verifier itself generated earlier in the protocol.
The controlling system or protocol may protect against such an event by monitoring for any
duplication of the IVs that are presented for authenticated decryption. Alternatively, certain
identifying information can be incorporated into the AAD. Examples of such information
include a sequential message number or a timestamp. Upon successful verification of
authenticity, this information may provide a means for the detection of replayed messages, out-
of-sequence messages, or missing messages.
30 30

Page 39 Page 39
NIST Special Publication 800-38D
31 31
Appendix E: Bibliography
[1] [1]
Ferguson, N., Authentication Weaknesses in GCM, Natl. Inst. Inst. Stand. Stand. Technol. Technol.
[Web page], http://www.csrc.nist.gov/groups/ST/toolkit/BCM/documents/comments/
CWC-GCM/Ferguson2.pdf, May 20, 2005.
[2] [2]
FIPS Publication 197, The Advanced Encryption Standard (AES), US DoC/NIST,
November 26, 2001.
[3] [3]
FIPS Publication 140-2, Security Requirements for Cryptographic Modules, US
DoC/NIST, May 25, 2001.
[4] [4]
IEEE P1619.1™/D23, Draft Standard for Authenticated Encryption with Length
Expansion for Storage Devices.
[5] [5]
A. Joux, Authentication Failures in NIST version of GCM, Natl. Inst. Inst. Stand. Stand. Technol. Technol.
[Web page], http://www.csrc.nist.gov/groups/ST/toolkit/BCM/documents/comments/800-
38_Series-Drafts/GCM/Joux_comments.pdf.
[6] [6]
D. McGrew, J. Viega, The Galois/Counter Mode of Operation (GCM), Natl. Inst. Inst. Stand. Stand.
Technol. Technol. [Web page] , http://www.csrc.nist.gov/groups/ST/toolkit/BCM/documents/
proposedmodes/gcm/gcm-revised-spec.pdf, May 31, 2005.
[7] [7]
D. McGrew and J. Viega. The Security and Performance of the Galois/Counter Mode
(GCM) of Operation. Proceedings of INDOCRYPT '04, Springer-Verlag, 2004. Full
paper available from the IACR Cryptology ePrint Archive: Report 2004/193, [Web
page], http://eprint.iacr.org/2004/193/, October 7, 2004.
[9] [9]
National Institute of Standards and Technology and Communications Security
Establishment, Implementation Guidance for FIPS Pub. 140-2 and the Cryptographic
Module Validation Program, Natl. Inst. Inst. Stand. Stand. Technol. Technol. [Web page], http://csrc.nist.gov/
groups/STM/cmvp/documents/fips140-2/FIPS1402IG.pdf.
[10] NIST Special Publication 800-38A, 2001 ED, Version 1, Recommendation for Block
Cipher Modes of Operation—Methods and Techniques, December 2001, Natl. Inst. Inst.
Stand. Stand. Technol. Technol. [Web page] , http://www.csrc.nist.gov/publications/nistpubs/800-38a/
sp800-38a.pdf.