aboutsummaryrefslogtreecommitdiffstats
path: root/buch/chapters/90-crypto/images/shift.tex
blob: bcdf8193c68a8106fc092cd2a2894e85087232af (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
%
% shift.tex -- template for standalon tikz images
%
% (c) 2021 Prof Dr Andreas Müller, OST Ostschweizer Fachhochschule
%
\documentclass[tikz]{standalone}
\usepackage{amsmath}
\usepackage{times}
\usepackage{txfonts}
\usepackage{pgfplots}
\usepackage{csvsimple}
\usetikzlibrary{arrows,intersections,math}
\begin{document}
\def\skala{1}
\begin{tikzpicture}[>=latex,thick,scale=\skala]

\definecolor{darkgreen}{rgb}{0,0.6,0}

\def\s{0.8}
\def\punkt#1#2{({#1*\s},{#2*\s})}

\def\feld#1#2#3#4{
	\fill[color=#3] \punkt{#1}{#2} rectangle \punkt{(#1+1)}{(#2+1)};
	\node at \punkt{(#1+0.5)}{(#2+0.5)} {$\mathstrut #4$};
}
\def\gitter{
	\draw \punkt{0}{0} rectangle \punkt{8}{4};
	\foreach \x in {1,...,7}{
		\draw \punkt{\x}{0} -- \punkt{\x}{4};
	}
	\foreach \y in {1,...,3}{
		\draw \punkt{0}{\y} -- \punkt{8}{\y};
	}
}

\begin{scope}
	\feld{0}{3}{red!20}{b_{0}}
	\feld{0}{2}{red!20}{b_{1}}
	\feld{0}{1}{red!20}{b_{2}}
	\feld{0}{0}{red!20}{b_{3}}

	\feld{1}{3}{red!10}{b_{4}}
	\feld{1}{2}{red!10}{b_{5}}
	\feld{1}{1}{red!10}{b_{6}}
	\feld{1}{0}{red!10}{b_{7}}

	\feld{2}{3}{yellow!20}{b_{8}}
	\feld{2}{2}{yellow!20}{b_{9}}
	\feld{2}{1}{yellow!20}{b_{10}}
	\feld{2}{0}{yellow!20}{b_{11}}

	\feld{3}{3}{yellow!10}{b_{12}}
	\feld{3}{2}{yellow!10}{b_{13}}
	\feld{3}{1}{yellow!10}{b_{14}}
	\feld{3}{0}{yellow!10}{b_{15}}

	\feld{4}{3}{darkgreen!20}{b_{16}}
	\feld{4}{2}{darkgreen!20}{b_{17}}
	\feld{4}{1}{darkgreen!20}{b_{18}}
	\feld{4}{0}{darkgreen!20}{b_{19}}

	\feld{5}{3}{darkgreen!10}{b_{20}}
	\feld{5}{2}{darkgreen!10}{b_{21}}
	\feld{5}{1}{darkgreen!10}{b_{22}}
	\feld{5}{0}{darkgreen!10}{b_{23}}

	\feld{6}{3}{blue!20}{b_{24}}
	\feld{6}{2}{blue!20}{b_{25}}
	\feld{6}{1}{blue!20}{b_{26}}
	\feld{6}{0}{blue!20}{b_{27}}

	\feld{7}{3}{blue!10}{b_{28}}
	\feld{7}{2}{blue!10}{b_{29}}
	\feld{7}{1}{blue!10}{b_{30}}
	\feld{7}{0}{blue!10}{b_{31}}

	\gitter

	\draw[->] \punkt{8.1}{2} -- \punkt{9.3}{2};
\end{scope}


\begin{scope}[xshift=7.5cm]

	\feld{0}{3}{red!20}{b_{0}}
	\feld{1}{2}{red!20}{b_{1}}
	\feld{2}{1}{red!20}{b_{2}}
	\feld{3}{0}{red!20}{b_{3}}

	\feld{1}{3}{red!10}{b_{4}}
	\feld{2}{2}{red!10}{b_{5}}
	\feld{3}{1}{red!10}{b_{6}}
	\feld{4}{0}{red!10}{b_{7}}

	\feld{2}{3}{yellow!20}{b_{8}}
	\feld{3}{2}{yellow!20}{b_{9}}
	\feld{4}{1}{yellow!20}{b_{10}}
	\feld{5}{0}{yellow!20}{b_{11}}

	\feld{3}{3}{yellow!10}{b_{12}}
	\feld{4}{2}{yellow!10}{b_{13}}
	\feld{5}{1}{yellow!10}{b_{14}}
	\feld{6}{0}{yellow!10}{b_{15}}

	\feld{4}{3}{darkgreen!20}{b_{16}}
	\feld{5}{2}{darkgreen!20}{b_{17}}
	\feld{6}{1}{darkgreen!20}{b_{18}}
	\feld{7}{0}{darkgreen!20}{b_{19}}

	\feld{5}{3}{darkgreen!10}{b_{20}}
	\feld{6}{2}{darkgreen!10}{b_{21}}
	\feld{7}{1}{darkgreen!10}{b_{22}}
	\feld{0}{0}{darkgreen!10}{b_{23}}

	\feld{6}{3}{blue!20}{b_{24}}
	\feld{7}{2}{blue!20}{b_{25}}
	\feld{0}{1}{blue!20}{b_{26}}
	\feld{1}{0}{blue!20}{b_{27}}

	\feld{7}{3}{blue!10}{b_{28}}
	\feld{0}{2}{blue!10}{b_{29}}
	\feld{1}{1}{blue!10}{b_{30}}
	\feld{2}{0}{blue!10}{b_{31}}

	\gitter

\end{scope}

\end{tikzpicture}
\end{document}