LaTeX TikZ for Cryptographers
iacr.org
iacr.org
Asymptote [0] is a great alternative to prepare precise illustrations programmatically, which also integrates neatly with LaTeX. Making figures like [1] for a thesis (all lines and intersection points computed exactly) was actually fun.
But for diagrams with lines and boxes I would really just use Inkscape.
I agree with your sentiment on tikz though, it is not a pleasure to write.
\node[latent, left=of y, yshift=0.5cm] (mu) {$\mu$} ;
Now that I'm no longer in academia, I've lost my muscle memory for the syntax, but every time I need to build a flowchart, I think back on this with fondness. If someone were to repackage this with a cloud-based IDE and autocomplete (maybe using something like https://latexbase.com/ ), maybe slightly kinder syntax, I could see it meeting a business need even for non-technical users who are fed up with the difficulty of "fitting something in" in a large PowerPoint flowchart.There's also http://sketch4latex.sourceforge.net/ for 3D drawing, which is equally cool.
On the unreasonable amount of time spent: Last December, "merely" to get the arrows right neatly arranged, I spent more than 2 hours :-(. See the transition from: wonky-arrows1.png --> wonky-arrows2.png --> much-better-arrows3.png --> even-better-arrows4.png (the "final") here[1].
In two months I have another deadline to produce some technical material with TikZ diagrams (that's my choice, though). I'm determined to become more efficient at it.
At some point during my PhD I accepted that LaTeX is not the right tool for graphical work. Stubbornly I was still texing my slides with Beamer, but half their content was figures prepared in Inkscape.
[1] https://www.yworks.com/yed-live/#file=https://gist.githubuse...
Is that caused by the tails of the letters "y" and "p"? The one box that doesn't have a tailed letter, "base", looks fine. There should be a way to tell the system to use the normal font baseline instead of something it can figure out geometrically.
In Inkscape you would just shift-click all words and click the baseline icon in the align-and-distribute panel.
The thing with preparing figures is that you want to iterate rapidly on small changes. That works so much better without a mental context switch between code and result and without having to wait for the compilation to finish (significant if the figure is embedded in a large document).
If you had to prepare hundreds of very similar diagrams that all need to look great, then I could understand the point of using TikZ for such a job.
Typesetting document text is different because LaTeX does a great job by default.
On Inkscape, another colleague also suggested it. I'll give it a try next week. My main use of LaTex (with Beamer) + TikZ is for not too complicated diagrams for presentations.
There is no greater time-sink than writing a true program in Latex... I generally write a C++ program to write the latex/Tikz code using the most basic primitives. I would prefer to do layout using a pure C++ 2d library such as SFML and then export a 'screen' as a PDF. But, to date we haven't been able to match the sheer 'beauty' of Latex/Tkz output.
Shameless plug for our puzzle books: search Amazon for Klooto Games.
This looks reasonably complete for a lot of the mathematical diagrams in cryptography. It would be nice if the supersingular isogeny support included more diagrams than just the Diffie Hellman key exchange protocol, but they’re a relatively recent are of study so it makes sense. But there are a lot of isogeny diagrams (such as endomorphisms, volcanoes and random walks) beyond SIDH.
For example, Luca De Feo’s 2017 article on isogeny mathematics in cryptography [1] (pages 10,11,13,18,21,27,28,32,35) and the 2011 Feo-Jao-Plut paper introducing isogeny key exchange [2] (pages 4,6,8,9,10) both have very beautiful, full-color diagrams to walk through very complex concepts. Luca De Feo has a tendency to put the TeX of his papers and slides on GitHub [3], so I’ve reused some of his diagrammatic code before :). I recall spending hours on some diagrams to make them look as nice as these.
Lattice-based constructions sometimes need good diagrammatic code as well, but thankfully you can mostly get by without it (even though lattice depictions can be pretty, as one of De Feo’s GitHub packages shows) - for instance, note the relative lack of diagrams in Peikert’s well-known survey on lattice cryptography [4].
____________________
1. https://arxiv.org/abs/1711.04062
2. https://eprint.iacr.org/2011/506.pdf
4. https://web.eecs.umich.edu/~cpeikert/pubs/lattice-survey.pdf
https://ctan.org/pkg/pgf https://sourceforge.net/projects/pgf/
[1] for some values of easy.