encrypt() -> compute() -> decrypt()

GitHub

Ren is an open-source engine for computing on encrypted data.

We implement CKKS for approximate computation on encrypted numbers. You write arithmetic in Python, and Ren compiles it into GPU kernels.

Why?

We started building Ren after trying to use fully homomorphic encryption in the real world. That experience led us to write our own engine:

  1. We wanted to deepen our understanding of the math and try our ideas for making encrypted computation practical.
  2. We needed speed and flexibility for real applications. Building all the layers as part of Ren gives us control over how a computation runs, from the CKKS implementation down to the GPU kernels .
  3. We wanted mathematicians and cryptographers to be able to write their ideas the way they think about them. Ren's Python APIs... TODO.

Main components

Ren's architecture is based on tinygrad, a machine learning library that compiles tensor operations into GPU kernels. Ren takes a similar approach to the polynomial arithmetic underlying CKKS.

CKKS. This layer defines how to compute on encrypted vectors. It implements operations such as ciphertext multiplication and rotation in terms of arithmetic on the polynomials that make up a ciphertext.

Polynomials. This layer lets you express arithmetic in a polynomial ring and records the operations as a graph. The CKKS implementation uses the same Poly API that someone experimenting with polynomial algorithms can use directly.

Compilation and execution. Ren lowers polynomial operations to a graph of simpler operations. The CUDA renderer translates the lowered graph into CUDA source, which the CUDA compiler builds into kernels for the GPU. The Python backend interprets the lowered operations directly and serves as a reference for testing. For repeated computations, ren.jit can capture the kernel calls once and replay them on new inputs.

What we're exploring

We build applications to explore what becomes possible when people can contribute to a shared computation without revealing their data, and what it takes to make those computations practical.

TODO... Maybe include here some things in the roadmap?

We plan to share more of the tools and demos we've built with Ren over the coming months.

Notes

CKKS IR

Today the compiler sees the polynomial operations that implement x**2. We'd like it to see the ciphertext multiplication itself before we expand it into polynomials. A CKKS intermediate representation (IR) would let us express that operation using the graph and rewrite machinery Ren already has.

The first step is to lower the new representation to the same polynomial operations Ren produces today. Once that works, we can explore delaying relinearization across operations, planning scales and levels, and choosing where to bootstrap.

Air quality sensors

More than 3,000 devices were ordered for the production run of the air quality sensors. We used our earlier library for that project. We plan to use Ren for future deployments.