Multilinear Galois Mode (MGM)
CryptoPro
+7 (495) 9954820
svs@cryptopro.ru
TC 26
nozdrunov_vi@tc26.ru
TC 26
shishkin_va@tc26.ru
CryptoPro
griboedovaekaterina@gmail.com
General
Network Working Group
authenticated encryption
mode of operation
AEAD
Multilinear Galois Mode (MGM) is an Authenticated Encryption
with Associated Data (AEAD) block cipher mode based on the
EncryptthenMAC (EtM) principle. MGM is defined for use with
64bit and 128bit block ciphers.
MGM has been standardized in Russia. It is used as an AEAD
mode for the GOST block cipher algorithms in many protocols,
e.g., TLS 1.3 and IPsec. This document provides a reference for
MGM to enable review of the mechanisms in use and to make MGM
available for use with any block cipher.
Introduction
Multilinear Galois Mode (MGM) is an Authenticated Encryption
with Associated Data (AEAD) block cipher mode based on EtM
principle. MGM is defined for use with 64bit and 128bit
block ciphers. The MGM design principles can easily be
applied to other block sizes.
MGM has been standardized in Russia . It is used as
an AEAD mode for the GOST block cipher algorithms in many
protocols, e.g., TLS 1.3 and IPsec. This document provides a
reference for MGM to enable review of the mechanisms in use
and to make MGM available for use with any block cipher.
This document does not have IETF consensus and does not imply
IETF support for MGM.
Conventions Used in This Document
The key words "MUST", "MUST
NOT", "REQUIRED",
"SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT",
"RECOMMENDED", "NOT
RECOMMENDED", "MAY", and
"OPTIONAL" in this document are to be
interpreted as described in BCP 14
when, and only when, they appear in all capitals, as shown
here.
Basic Terms and Definitions
This document uses the following terms and definitions for the sets and operations
on the elements of these sets:
 V*

The set of all bit strings of a finite length
(hereinafter referred to as strings), including the
empty string; substrings and string components are
enumerated from right to left starting from zero.
 V_s

The set of all bit strings of length s, where s is a
nonnegative integer. For s = 0, the V_0 consists of a
single empty string.
 X

The bit length of the bit string X (if X is an empty
string, then X = 0).
 X  Y

Concatenation of strings X and Y both belonging to V*,
i.e., a string from V_{X+Y}, where the left
substring from V_{X} is equal to X, and the right
substring from V_{Y} is equal to Y.
 a^s

The string in V_s that consists of s 'a' bits.
 (xor)

Exclusiveor of two bit strings of the same
length.
 Z_{2^s}

Ring of residues modulo 2^s.
 MSB_i
 V_s > V_i
The transformation that maps the string X =
(x_{s1}, ... , x_0) in V_s into the string MSB_i(X) =
(x_{s1}, ... , x_{si}) in V_i, i <= s (most
significant bits).
 Int_s
 V_s > Z_{2^s}
The transformation that maps the string X =
(x_{s1}, ... , x_0) in V_s, s > 0, into the integer
Int_s(X) = 2^{s1} * x_{s1} + ... + 2 * x_1 + x_0 (the
interpretation of the bit string as an integer).
 Vec_s
 Z_{2^s} > V_s
The transformation inverse to the mapping Int_s
(the interpretation of an integer as a bit string).
 E_K
 V_n > V_n
The block cipher permutation under the key K in V_k.
 k

The bit length of the block cipher key.
 n

The block size of the block cipher (in bits).
 len
 V_s > V_{n/2}
The transformation that maps a string X in V_s, 0
<= s <= 2^{n/2}  1, into the string len(X) =
Vec_{n/2}(X) in V_{n/2}, where n is the block size
of the used block cipher.
 [+]

The addition operation in Z_{2^{n/2}}, where n is the
block size of the used block cipher.
 (x)

The transformation that maps two strings, X = (x_{n1},
... , x_0) in V_n and Y = (y_{n1}, ... , y_0), in V_n
into the string Z = X (x) Y = (z_{n1}, ... , z_0) in
V_n; the string Z corresponds to the polynomial Z(w) =
z_{n1} * w^{n1} + ... + z_1 * w + z_0, which is the
result of multiplying the polynomials X(w) = x_{n1} *
w^{n1} + ... + x_1 * w + x_0 and Y(w) = y_{n1} *
w^{n1} + ... + y_1 * w + y_0 in the field GF(2^n),
where n is the block size of the used block cipher; if
n = 64, then the field polynomial is equal to f(w) =
w^64 + w^4 + w^3 + w + 1; if n = 128, then the field
polynomial is equal to f(w) = w^128 + w^7 + w^2 + w +
1.
 incr_l
 V_n > V_n
The transformation that maps an nbyte string A = L  R into the nbyte
string incr_l(A) = Vec_{n/2}(Int_{n/2}(L) [+] 1)  R, where L and R are
n/2byte strings.
 incr_r
 V_n > V_n
The transformation that maps an nbyte string A = L  R into the nbyte
string incr_r(A) = L  Vec_{n/2}(Int_{n/2}(R) [+] 1), where L and R are
n/2byte strings.
Specification
An additional parameter that defines the functioning of
MGM is the bit length S of the
authentication tag, 32 <= S <= n. The value of S
MUST be fixed for a particular protocol. The
choice of the value S involves a tradeoff between message
expansion and the forgery probability.
MGM Encryption and Tag Generation Procedure
The MGM encryption and tag generation procedure takes the
following parameters as inputs:

Encryption key K in V_k.

Initial counter nonce ICN in V_{n1}.

Associated authenticated data A, 0 <= A <
2^{n/2}. If A > 0, then A = A_1  ... 
A*_h, A_j in V_n, for j = 1, ... , h  1, A*_h in
V_t, 1 <= t <= n. If A = 0, then by
definition A*_h is empty, and the h and t
parameters are set as follows: h = 0, t = n. The
associated data is authenticated but is not
encrypted.

Plaintext P, 0 <= P < 2^{n/2}. If P >
0, then P = P_1  ...  P*_q, P_i in V_n, for i
= 1, ... , q  1, P*_q in V_u, 1 <= u <=
n. If P = 0, then by definition P*_q is empty,
and the q and u parameters are set as follows: q =
0, u = n.
The MGM encryption and tag generation procedure outputs
the following parameters:
 Initial counter nonce ICN.
 Associated authenticated data A.
 Ciphertext C in V_{P}.
 Authentication tag T in V_S.
The MGM encryption and tag generation procedure consists
of the following steps:
The ICN value for each message that is encrypted under
the given key K must be chosen in a unique manner.
Users who do not wish to encrypt plaintext can provide a
string P of zero length. Users who do not wish to
authenticate associated data can provide a string A of
zero length. The length of the associated data A and of
the plaintext P MUST be such that 0 <
A + P < 2^{n/2}.
MGM Decryption and Tag Verification Check Procedure
The MGM decryption and tag verification procedure takes the following parameters as inputs:

Encryption key K in V_k.

Initial counter nonce ICN in V_{n1}.

Associated authenticated data A, 0 <= A <
2^{n/2}. If A > 0, then A = A_1  ... 
A*_h, A_j in V_n, for j = 1, ... , h  1, A*_h in
V_t, 1 <= t <= n. If A = 0, then by
definition A*_h is empty, and the h and t
parameters are set as follows: h = 0, t = n. The
associated data is authenticated but is not
encrypted.

Ciphertext C, 0 <= C < 2^{n/2}. If C > 0, then C = C_1  ...  C*_q, C_i in V_n, for i = 1, ... , q  1, C*_q in V_u, 1 <= u <= n.
If C = 0, then by definition C*_q is empty, and the q and u parameters
are set as follows: q = 0, u = n.

Authentication tag T in V_S.
The MGM decryption and tag verification procedure outputs FAIL or the following parameters:
 Associated authenticated data A.
 Plaintext P in V_{C}.
The MGM decryption and tag verification procedure consists of the following steps:
The length of the associated data A and of the ciphertext C MUST be such that 0 < A + C < 2^{n/2}.
Rationale
MGM was originally proposed in .
From the operational point of view, MGM is designed to be
parallelizable, inverse free, and online and is also designed to provide
availability of precomputations.
Parallelizability of MGM is achieved due to its
countertype structure and the usage of the multilinear
function for authentication. Indeed, both encryption blocks
E_K(Y_i) and authentication blocks H_i are produced in the
counter mode manner, and the multilinear function determined
by H_i is parallelizable in itself. Additionally, the
countertype structure of the mode provides the inversefree
property.
The online property means the possibility of processing messages
even if it is not completely received (so its length is
unknown). To provide this property, MGM uses blocks
E_K(Y_i) and H_i, which are produced based on two independent
source blocks Y_i and Z_i.
Availability of precomputations for MGM means the possibility of calculating H_i and E_K(Y_i) even before
data is retrieved. It holds again due to the usage of counters for calculating them.
Security Considerations
The security properties of MGM are based on the following:
 Different functions generating the counter values:
 The functions incr_r and incr_l are chosen to minimize
intersection (if it happens) of counter values Y_i and Z_i.
 Encryption of the multilinear function output:
 It allows attacks based on padding
and linear properties to be resisted (see for details).
 Multilinear function for authentication:
 It allows the small subgroup attacks to be resisted .
 Encryption of the nonces (0^1  ICN) and (1^1  ICN):
 The use of this encryption minimizes the number of
plaintext/ciphertext pairs of blocks known to an adversary.
It prevents attacks that need a substantial amount of such material (e.g.,
linear and differential cryptanalysis and sidechannel attacks).
It is crucial to the security of MGM to use unique ICN
values. Using the same ICN values for two different messages
encrypted with the same key eliminates the security properties
of this mode.
It is crucial for the security of MGM not to process empty
plaintext and empty associated data at the same
time. Otherwise, a tag becomes independent from a nonce value,
leading to vulnerability to forgery attacks.
Security analysis for MGM with E_K being a random permutation
was performed in . More precisely, the bounds for
confidentiality advantage (CA) and integrity advantage (IA)
(for details, see ) were obtained. According to these results,
for an adversary making at most q encryption queries with the
total length of plaintexts and associated data of at most s
blocks, and allowed to output a forgery with the summary length
of ciphertext and associated data of at most l blocks:
CA <= ( 3( s + 4q )^2 )/ 2^n,
IA <= ( 3( s + 4q + l + 3 )^2 )/ 2^n + 2/2^S,
where n is the block size and S is the authentication tag size.
These bounds can be used as guidelines on how to calculate
confidentiality and integrity limits (for details, also see
).
IANA Considerations
This document has no IANA actions.
References
Normative References
Informative References
Parallel and double block cipher mode of operation (PDmode) for authenticated encryption
CTCrypt 2017 proceedings, pp. 3645
Information technology. Cryptographic data security. Block ciphers
Federal Agency on Technical Regulating and Metrology
GOST R 34.122015
Authentication weaknesses in GCM
Information technology. Cryptographic data
security. Authenticated encryption block cipher
operation modes
Federal Agency on Technical Regulating and Metrology
R 1323565.1.0262019
Cycling Attacks on GCM, GHASH and Other Polynomial MACs and Hashes
Fast Software Encryption
FSE 2012 proceedings, pp. 216225
Security of Multilinear Galois Mode (MGM)
IACR Cryptology ePrint Archive 2019, pp. 123
Test Vectors
Test Vectors for the Kuznyechik Block Cipher
Test vectors for the Kuznyechik block cipher (n = 128, k = 256) are defined in (the English version can be found in ).
Example 1
 Encryption step:
 Padding step:
 Authentication tag T generation step:
Example 2
 Encryption step:
 Padding step:
 Authentication tag T generation step:
Test Vectors for the Magma Block Cipher
Test vectors for the Magma block cipher (n = 64, k = 256) are
defined in
(the English version can be found in ).
Example 1
 Encryption step:
 Padding step:
 Authentication tag T generation step:
Example 2
 Encryption step:
 Padding step:
 Authentication tag T generation step:
Contributors
CryptoPro
alekseev@cryptopro.ru
CryptoPro
babueva@cryptopro.ru
CryptoPro
lah@cryptopro.ru
TC 26
marshalko_gb@tc26.ru
TC 26
rudskoy_vi@tc26.ru
National Research University Higher School of Economics
anesterenko@hse.ru
CryptoPro
nikiforova@cryptopro.ru