04 May 2024
https://www.jeremykun.com/2024/05/04/fhe-overview/
About two years ago, I switched teams at Google to focus on fully homomorphic encryption (abbreviated FHE, or sometimes HE). Since then I’ve got to work on a lot of interesting projects, learning along the way about post-quantum cryptography, compiler design, and the ins and outs of fully homomorphic encryption.
If you’ve heard about FHE and you’re a software person, you’ve probably heard two things: it lets you run programs directly on encrypted data without ever decrypting it; and it’s still t...
04 Sep 2026
https://www.jeremykun.com/2026/09/04/updates-on-heir-homomorphic-encryption/
On 2026-08-14 I published an article on the Google Security blog with an update on HEIR, our homomorphic encryption (HE) compiler. This is a companion article, in which I have no limits on word count or jargon, and I can feel free to be honest. So strap in.
Assuming you won’t read the linked corporate blog post, HEIR is a compiler that converts an input program to a program that operates directly on encrypted data.
22 May 2026
https://www.jeremykun.com/shortform/2026-05-22-1528/
Here are some more whimsical OEIS sequences I came across.
XKCD 2016 joked that “OEIS keeps rejecting my submissions,” including one that gives “Integers in increasing order of width when printed in Helvetica.” Well, two days after that comic was published (2018-07-09), Hugo Pfoertner published A316600, with a very precise definition. Then he did Arial.
Randall Munroe missed a huge opportunity to commit to his bit and actually try to submit some of his sequences before publishing the comic.
29 Apr 2026
https://www.jeremykun.com/2026/04/29/ckks-polynomials-the-canonical-embedding-and-encoding/
Table of Contents
In this tutorial series, I will introduce the CKKS homomorphic encryption scheme from the ground up, in rather intricate detail. Each article in this series corresponds to a pull request on a GitHub repository. The code for this article is in this pull request. Follow along by cloning the repository and checking out the code at the relevant commit.
This first article will cover some of the mathematical background necessary in the formulation of the CKKS encryption scheme, speci...
13 Apr 2026
https://www.jeremykun.com/shortform/2026-04-13-0700/
I went hunting for references to the OEIS in open source code, and found some weird ones.
There are not one, but two live-coding music frameworks that use OEIS sequences as a source for “anything that can be sequenced” in music. I’m guessing that’s used for choosing pseudorandom melodies, interesting rhythyms, or how to overlap tracks in different ways.
The first project is called mercury, which is advertised as having “an extensive library of algorithms to generate or transform numbersequences ...
09 Apr 2026
https://www.jeremykun.com/shortform/2026-04-09-0556/
A051070 is a sequence about OEIS sequences. a(n) is the n-th term in sequence A_n (or -1 if A_n doesn’t have enough terms).
So the first term in A051070 is 1 because A000001 is the number of groups of order n, and that sequence has 1 as its entry in index 1. A000002 is the Kolakoski sequence (what? For another time) and has value 2 in entry 2. The sequence continues: 1, 2, 1, 0, 2, 3, 0, 7, 8, 4, 63, 1, 316, …
07 Apr 2026
https://www.jeremykun.com/2026/04/07/deterministic-miller-rabin/
Problem: Determine if a 32-bit number is prime (deterministically)
Solution: (in C++)
// Bases to test. Using the first 4 prime bases makes the test deterministic // for all 32-bit integers. See https://oeis.org/A014233. int64_t bases[] = {2, 3, 5, 7}; inline int countTrailingZeros(uint64_t n) { if (n == 0) return 64; return __builtin_ctzll(n); } int64_t modularExponentiation(int64_t base, int64_t exponent, int64_t modulus) { int64_t res = 1; int64_t b = base % modulus; int64_t e = exponent; whi...
01 Apr 2026
https://www.jeremykun.com/2026/04/01/irrational-decision-book-review/
It’s the 5th annual April Cools! Here are my previous April Cools articles This year it’s a book review of Ben Recht’s book, The Irrational Decision: How We Gave Computers the Power to Choose For us, released Mar 10, 2026.
The publishing industry has a stupid name for the subcategory of non-fiction book where a domain expert weaves factual evidence together into a story to try to convince you of their thesis: a “big idea” book.
17 Nov 2025
https://www.jeremykun.com/2025/11/17/bicyclic-matrix-matrix-multiplication-in-fully-homomorphic-encryption/
In an earlier article, I covered the basic technique for performing matrix-vector multiplication in fully homomorphic encryption (FHE), known as the Halevi-Shoup diagonal method. This article covers a more recent method for matrix-matrix multiplication known as the bicyclic method.
The code implementing this method is in the same GitHub repository as the previous article, and the bicyclic method is in a file called bicyclic.py.
The previous article linked above covers the general concepts behind...
19 Oct 2025
https://www.jeremykun.com/2025/10/19/isl-a-primer/
Polyhedral optimization is a tool used in compilers for optimizing loop nests. While the major compilers that use this implement polyhedral optimizations from scratch,1 there is a generally-applicable open source C library called the Integer Set Library (ISL) that implements the core algorithms used in polyhedral optimization.
This article gives an overview of a subset of ISL, mainly focusing on the representation of sets and relations and basic manipulations on them.