Encrypted Matrix Multiplication
encrypted-matrix-multiplication · spec v0.1.0 · 0 implementations · 6 runners
DESCRIPTION
Computes A × B for two encrypted matrices.
The arithmetic is the easy part. The difficulty is that a ciphertext is a flat vector of slots and a matrix is not, so a realization must choose how to lay the matrix out and then pay for that choice in data movement. The three families in use trade the same three resources differently:
- row-wise encoding is general and needs d² slots, with roughly 2d multiplications and 2d + 3·log₂d − 2 rotations;
- diagonal encoding can reach d + 2√d operations but wants d³ slots and depth three, and dropping to depth two costs many more rotations;
- hypercube encodings reach depth two directly, at the price of leaving the standard scheme behind.
None of these is the kernel. The kernel is the product, and which layout wins at which size is precisely what benchmarking it answers.
INTERFACE
encrypted_matmul( in ct : Ciphertext // the encrypted left matrix A in ct_b : Ciphertext // the encrypted right matrix B out ct : Ciphertext // the encrypted product A × B ... // anything else the realization needs — keys, context, encoding — is its own concern )
PARAMETER SCHEMA
The schema belongs to the kernel. Each implementation declares which part of it it supports.
CORRECTNESS
SECURITY PROPERTIES
Both operands stay encrypted; neither the entries nor their layout reveal values.
ASSUMPTIONS
Matrix dimensions are public. Rotation keys, where a layout needs them, are supplied.