# Programming

## LaTeX

Here is LaTeX package to draw easily and quickly differential paths such as the ones below.

Example of LaTeX code for the first picture of this page (four AES rounds):
\begin{tikzpicture}
\defineStateSize{4}
\defineArrowLength{3}
\defineXGap{0}
\defineYGap{2}
\defineStateIndex{1}
\initdiffpath
%%%%%%%%%%%%%%%%%%%% round 1
\colorstate{
B...
....
....
....
}{SB}
\colorstate{
B...
....
....
....
}{SR}
\colorstate{
B...
....
....
....
}{MC}
\colorstate{
B...
B...
B...
B...
}{AK}
\colorstate{
B...
B...
B...
B...
}{0}
%%%%%%%%%%%%%%%%%%%% round 2
\colorstate{
B...
B...
B...
B...
}{SB}
\colorstate{
B...
B...
B...
B...
}{SR}
\colorstate{
B...
...B
..B.
.B..
}{MC}
\colorstate{
BBBB
BBBB
BBBB
BBBB
}{AK}
\colorstate{
BBBB
BBBB
BBBB
BBBB
}{0}
%%%%%%%%%%%%%%%%%%%% round 3
\colorstate{
BBBB
BBBB
BBBB
BBBB
}{SB}
\colorstate{
BBBB
BBBB
BBBB
BBBB
}{SR}
\colorstate{
BBBB
BBBB
BBBB
BBBB
}{MC}
\colorstate
B...
.B..
..B.
...B
}{AK}
\colorstate{
B...
.B..
..B.
...B
}{0}

%%%%%%%%%%%%%%%%%%%% round 4
\colorstate{
B...
.B..
..B.
...B
}{SB}
\colorstate{
B...
.B..
..B.
...B
}{SR}
\colorstate{
B...
B...
B...
B...
}{MC}
\colorstate{
B...
....
....
....
}{AK}
\colorstate{
B...
....
....
....
}{0}
\end{tikzpicture}