From c4446c32a0fd6e829959ca2bf84bbad211554a87 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andreas=20M=C3=BCller?= <andreas.mueller@othello.ch>
Date: Tue, 6 Apr 2021 16:40:17 +0200
Subject: add new stuff

---
 buch/chapters/90-crypto/images/shift.tex | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)
 create mode 100644 buch/chapters/90-crypto/images/shift.tex

(limited to 'buch/chapters/90-crypto/images/shift.tex')

diff --git a/buch/chapters/90-crypto/images/shift.tex b/buch/chapters/90-crypto/images/shift.tex
new file mode 100644
index 0000000..5cfdd92
--- /dev/null
+++ b/buch/chapters/90-crypto/images/shift.tex
@@ -0,0 +1,30 @@
+%
+% 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]
+
+\def\s{1}
+\def\punkt#1#2{({#1*\s},{#2*\s})}
+
+\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};
+}
+
+\end{tikzpicture}
+\end{document}
+
-- 
cgit v1.2.1


From 8c4ba3a03eb7d0169d7b7ec29fce05840518e1a7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andreas=20M=C3=BCller?= <andreas.mueller@othello.ch>
Date: Wed, 7 Apr 2021 19:59:03 +0200
Subject: add missing files

---
 buch/chapters/90-crypto/images/shift.tex | 113 +++++++++++++++++++++++++++++--
 1 file changed, 107 insertions(+), 6 deletions(-)

(limited to 'buch/chapters/90-crypto/images/shift.tex')

diff --git a/buch/chapters/90-crypto/images/shift.tex b/buch/chapters/90-crypto/images/shift.tex
index 5cfdd92..bcdf819 100644
--- a/buch/chapters/90-crypto/images/shift.tex
+++ b/buch/chapters/90-crypto/images/shift.tex
@@ -14,17 +14,118 @@
 \def\skala{1}
 \begin{tikzpicture}[>=latex,thick,scale=\skala]
 
-\def\s{1}
+\definecolor{darkgreen}{rgb}{0,0.6,0}
+
+\def\s{0.8}
 \def\punkt#1#2{({#1*\s},{#2*\s})}
 
-\draw \punkt{0}{0} rectangle \punkt{8}{4};
-\foreach \x in {1,...,7}{
-	\draw \punkt{\x}{0} -- \punkt{\x}{4};
+\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$};
 }
-\foreach \y in {1,...,3}{
-	\draw \punkt{0}{\y} -- \punkt{8}{\y};
+\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}
 
-- 
cgit v1.2.1

