2
0
Fork 0
mirror of https://github.com/MartinThoma/LaTeX-examples.git synced 2025-04-24 22:08:04 +02:00

added IND-CPA

This commit is contained in:
Martin Thoma 2013-05-02 10:41:34 +02:00
parent 01f5f2ecf9
commit 4478393fb8
4 changed files with 61 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View file

@ -0,0 +1,23 @@
\documentclass{article}
\usepackage[pdftex,active,tightpage]{preview}
\usepackage{tikz}
\usetikzlibrary{calc}
\begin{document}
\begin{preview}
\tikzstyle{vertex}=[draw,fill=black!15,circle,minimum size=20pt,inner sep=0pt]
\tikzstyle{encrypt}=[draw,fill=black!15,rectangle,minimum size=20pt,inner sep=0pt]
\begin{tikzpicture}
\node (A)[draw, minimum height=2cm,fill=black!15] at (0,0) {$\mathcal{A}$};
\node (E)[draw, minimum height=2cm,fill=black!15] at (4,0) {$Enc(K, \cdot)$};
\draw[->,thick] (A.north east) -- node[sloped, above=-0.1cm] {$\scriptstyle M^{(1)}$} (E.north west);
\draw[->,thick] (A.60) -- node[sloped, above=-0.1cm] {$\scriptstyle M^{(2)}$} (E.150);
\draw[->,thick] (E.179) -- node[sloped, above=-0.1cm] {$\scriptstyle C^* = Enc(K, M^{(b)})$} (A.east);
\draw[->,thick] (A.south)|- node[sloped, above=0.19cm,right=0.3cm] {rate $b$} (2,-2);
\draw[<-,very thick] (-0.5,-2) -- node[sloped, above=-0.05cm] {Zeit} (-0.5,1.5);
\end{tikzpicture}
\end{preview}
\end{document}

View file

@ -0,0 +1,35 @@
SOURCE = IND-CPA-Game
DELAY = 80
DENSITY = 300
WIDTH = 512
make:
pdflatex $(SOURCE).tex -output-format=pdf
make clean
clean:
rm -rf $(TARGET) *.class *.html *.log *.aux *.data *.gnuplot
gif:
pdfcrop $(SOURCE).pdf
convert -verbose -delay $(DELAY) -loop 0 -density $(DENSITY) $(SOURCE)-crop.pdf $(SOURCE).gif
make clean
png:
make
make svg
inkscape $(SOURCE).svg -w $(WIDTH) --export-png=$(SOURCE).png
transparentGif:
convert $(SOURCE).pdf -transparent white result.gif
make clean
svg:
make
#inkscape $(SOURCE).pdf --export-plain-svg=$(SOURCE).svg
pdf2svg $(SOURCE).pdf $(SOURCE).svg
# Necessary, as pdf2svg does not always create valid svgs:
inkscape $(SOURCE).svg --export-plain-svg=$(SOURCE).svg
rsvg-convert -a -w $(WIDTH) -f svg $(SOURCE).svg -o $(SOURCE)2.svg
inkscape $(SOURCE)2.svg --export-plain-svg=$(SOURCE).svg
rm $(SOURCE)2.svg

View file

@ -0,0 +1,3 @@
Compiled example
----------------
![Example](IND-CPA-Game.png)