MDS matrix

From HandWiki
Short description: Represents a function with diffusion properties useful in cryptography

An MDS matrix (maximum distance separable) is a matrix representing a function with certain diffusion properties that have useful applications in cryptography. Technically, an [math]\displaystyle{ m \times n }[/math] matrix [math]\displaystyle{ A }[/math] over a finite field [math]\displaystyle{ K }[/math] is an MDS matrix if it is the transformation matrix of a linear transformation [math]\displaystyle{ f(x) = Ax }[/math] from [math]\displaystyle{ K^n }[/math] to [math]\displaystyle{ K^m }[/math] such that no two different [math]\displaystyle{ (m + n) }[/math]-tuples of the form [math]\displaystyle{ (x, f(x)) }[/math] coincide in [math]\displaystyle{ n }[/math] or more components. Equivalently, the set of all [math]\displaystyle{ (m + n) }[/math]-tuples [math]\displaystyle{ (x, f(x)) }[/math] is an MDS code, i.e., a linear code that reaches the Singleton bound.

Let [math]\displaystyle{ \tilde A = \begin{pmatrix} \mathrm{I}_n \\ \hline \mathrm{A} \end{pmatrix} }[/math] be the matrix obtained by joining the identity matrix [math]\displaystyle{ \mathrm{I}_n }[/math] to [math]\displaystyle{ A }[/math]. Then a necessary and sufficient condition for a matrix [math]\displaystyle{ A }[/math] to be MDS is that every possible [math]\displaystyle{ n \times n }[/math] submatrix obtained by removing [math]\displaystyle{ m }[/math] rows from [math]\displaystyle{ \tilde A }[/math] is non-singular. This is also equivalent to the following: all the sub-determinants of the matrix [math]\displaystyle{ A }[/math] are non-zero. Then a binary matrix [math]\displaystyle{ A }[/math] (namely over the field with two elements) is never MDS unless it has only one row or only one column with all components [math]\displaystyle{ 1 }[/math].

Reed–Solomon codes have the MDS property and are frequently used to obtain the MDS matrices used in cryptographic algorithms.

Serge Vaudenay suggested using MDS matrices in cryptographic primitives to produce what he called multipermutations, not-necessarily linear functions with this same property.[1] These functions have what he called perfect diffusion: changing [math]\displaystyle{ t }[/math] of the inputs changes at least [math]\displaystyle{ m - t + 1 }[/math] of the outputs. He showed how to exploit imperfect diffusion to cryptanalyze functions that are not multipermutations.

MDS matrices are used for diffusion in such block ciphers as AES, SHARK, Square, Twofish, Anubis, KHAZAD, Manta, Hierocrypt, Kalyna, Camellia and HADESMiMC, and in the stream cipher MUGI and the cryptographic hash function Whirlpool, Poseidon.

References

  1. Vaudenay, Serge (1995), Preneel, Bart, ed., "On the need for multipermutations: Cryptanalysis of MD4 and SAFER", Fast Software Encryption (Berlin, Heidelberg: Springer Berlin Heidelberg) 1008: pp. 286–297, doi:10.1007/3-540-60590-8_22, ISBN 978-3-540-60590-4, http://link.springer.com/10.1007/3-540-60590-8_22, retrieved 2023-07-17