Code
I maintain some computer code for computations relating to my research. These scripts are mostly for the computer algebra systems Pari/GP and Sage. You are welcome to download and use these scripts; they and the software to run them (Pari & Sage) are free. Please let me know if you encounter errors.
Notes on usage
- To use a Pari/GP script, load the script by typing “\r filename” at the prompt, where filename includes the path, then see the script for descriptions of functions;
- To use a Sage script, type “attach(‘filename’)” at the prompt; it also works simply to cut and paste the text of the script file into the first cell of a notebook;
- To use a Sage notebook, upload it to the notebook interface.
Illustrating Number Theory
I’ve taken an interest in the illustration of number theory with computers and 3d printing, etc. Click here to view my gallery.
SIDH
Isogeny-based cryptography is a primary candidate for post-quantum cryptography.
- Attacking SIDH variants [ github ] – This code demonstrates the attacks in our paper, Improved torsion point attacks on SIDH variants with Victoria de Quehen, Péter Kutas, Chris Leonardi, Chloe Martindale, Lorenz Panny, and Christophe Petit.
Ring Learning with Errors
Ring Learning with Errors is a front-runner for a hard problem upon which to base post-quantum cryptography. Here are some algorithms for attempting to solve it.
- Ring-BKW [ Code etc. ] – This code supports my paper Algebraic aspects of solving Ring-LWE, including ring-based improvements in the Blum-Kalai-Wasserman algorithm.
- Ring-LWE and Poly-LWE attack [ Sage Notebook ] – This implements the algorithms in our paper Provably weak instances of Ring-LWE (with Yara Elias, Kristin E. Lauter and Ekin Ozman).
Modular Arithmetic
- Minkowski / Lattice [ Interactive Web App ] – A four-dimensional lattice seen through the circles of its vectors: each vector (a, τ) cuts the sphere in the circle a·x = τ, coloured and faded by its Minkowski norm. Deform the lattice continuously (stretches, shears, cone tilts, Lorentz boosts) and watch the circles move through the stereographic plane and the sphere; a norm strip isolates any shell.
- Rational Lines in RP² [ Interactive Web App ] – The SL(3,Z)-orbit of a projective line, drawn in an affine chart: every rational line ax + by + c = 0 up to a height cutoff, faded by arithmetic complexity, or the word ball under the elementary generators; three charts, a dual-plane view, line selection and a generator tool.
- Möbius Graphs [ Interactive Web App ] – The graph of a real Möbius transformation x ↦ (ax+b)/(cx+d) drawn on the torus RP¹ × RP¹ unfolded to a square, or all of SL(2,Z) with entries bounded by N at once; hover to identify each curve.
- Modular Arithmetic Playground [ Interactive Web App ] – The dynamics of x ↦ ax, x ↦ x + a, x ↦ x^a and x ↦ a^x on the integers mod n, drawn as cycles and trees or as string-art chords of a circle, morphing between the two. Handles moduli into the tens of thousands.
- Elliptic Curve Playground [ Interactive Web App ] – The dynamics of P ↦ aP and P ↦ P + Q on the points of y² = x³ + Ax + B mod n, drawn as cycles and trees or as the points in the plane mod n, morphing between the two. For composite n the chord–tangent formulas can fail; failing points flow into a sink labelled by the factor of n they reveal (Lenstra’s method in miniature).
Schmidt Arrangements
- Schmidt Arrangement Visualizer [ Interactive Web App ] – Explore the Schmidt arrangement of any imaginary quadratic field directly in the browser: progressive generation, exact circle data with verified Bianchi matrices, Gaussian Apollonian swaps, curvature and prime highlighting, and colouring tools.
- Schmidt Orbits [ Interactive Web App ] – Choose three -rational points on the Gaussian Schmidt arrangement; the circle through them and its entire -orbit are computed exactly and drawn in a contrasting colour over the arrangement.
- Apollonian-like packings and Schmidt Arrangements [ Sage Notebook | Interactive Web Page ] – This draws pictures of Schmidt Arrangements and K-Apollonian circle packings as described in my papers Visualizing the arithmetic of imaginary quadratic fields and The Apollonian structure of Bianchi groups.
- My graduate student, Daniel Martin, has some remarkable code for Schmidt arrangements and his own generalizations.
Elliptic Divisibility Sequences and Elliptic Nets
- Tate pairing computation via elliptic nets [ Pari/GP ] – This implements the algorithms in my paper The Tate pairing via elliptic nets. Note: For other implementations, see also Graeme Taylor, who has implemented it for SAGE and has notes on his improvements; Ben Lynn, who has implemented it in his Pairing-Based Cryptography Library as part of his thesis; and and Augusto Jun Devegili at University College Dublin. Many of the formulas my be found in my formulary.
- Elliptic Divisibility Sequences Tools [ Pari/GP | SAGE | Example Sage Notebook | PDF of Example Notebook ] – These are general-purpose algorithms for experimenting with elliptic divisibility sequences over any field. Move between sequences and curves, generate terms efficiently, etc. Many of the formulas may be found in my formulary.
- Elliptic Nets Tools [ Pari/GP ] – These are general-purpose algorithms for experimenting with rank two elliptic nets over any field. It requires the use of the Elliptic Divisibility Sequences Tools above. Many of the formulas may be found in my formulary.
Ethiopian Dinner Game
- Ethiopian Dinner Game [ view SAGE notebook online | SAGE script | SAGE notebook for download ] – Tools for experimenting with the Ethiopian Dinner Game. See the paper How to make the most of a shared meal: plan the last bite first.
Sage Mathematics Software
I do a wee little bit of development for the mathematical software Sage.
- Sage Mathematics Software
- Single cell Sage computation online (example 2+2 or EllipticCurve(’37a’).ap(79))
- Some example code for plotting (if you want to use the single cell above as a graphing tool)
- Look for me on trac (sage development)
- My group at Sage Days 33
- Sage Developer’s Guide
Support and Disclaimer
Some of this material is based upon work supported by the National Science Foundation, the National Security Agency, and the National Science and Engineering Research Council. Any opinions, findings and conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the National Science Foundation of the USA (NSF), the National Security Agency (NSA), or the National Science and Engineering Research Council of Canada (NSERC).