# Bicyclic Matrix-Matrix Multiplication in Fully Homomorphic Encryption

DevFeed: [Bicyclic Matrix-Matrix Multiplication in Fully Homomorphic Encryption](<https://devfeed.tech/articles/bicyclic-matrix-matrix-multiplication-in-fully-homomorphic-encryption-40492.md>)

Original publisher: [Read original article](<https://www.jeremykun.com/2025/11/17/bicyclic-matrix-matrix-multiplication-in-fully-homomorphic-encryption/>)

Published: 2025-11-17T16:41:28Z

Content type: tutorial

Language: en

Sources: [Jeremy Kun](<https://devfeed.tech/sources/jeremy-kun.md>)

Topics: [FHE](<https://devfeed.tech/topics/fhe.md>), [Encryption](<https://devfeed.tech/topics/encryption.md>), [Algorithm](<https://devfeed.tech/topics/algorithm.md>), [Code](<https://devfeed.tech/topics/code.md>), [GitHub](<https://devfeed.tech/topics/github.md>)

Tags: [algorithm](<https://devfeed.tech/tags/algorithm.md>), [circuit](<https://devfeed.tech/tags/circuit.md>), [code](<https://devfeed.tech/tags/code.md>), [cryptography](<https://devfeed.tech/tags/cryptography.md>), [encryption](<https://devfeed.tech/tags/encryption.md>), [fhe](<https://devfeed.tech/tags/fhe.md>), [github](<https://devfeed.tech/tags/github.md>), [homomorphic-encryption](<https://devfeed.tech/tags/homomorphic-encryption.md>), [linear-algebra](<https://devfeed.tech/tags/linear-algebra.md>), [lwe](<https://devfeed.tech/tags/lwe.md>), [mathematics](<https://devfeed.tech/tags/mathematics.md>), [programming](<https://devfeed.tech/tags/programming.md>), [rlwe](<https://devfeed.tech/tags/rlwe.md>)

## AI overview

This article explains the bicyclic method for matrix-matrix multiplication in fully homomorphic encryption. It introduces the method's packing scheme, relates it to Halevi-Shoup diagonal packing, and discusses properties including multiplicative depth, layout invariance, and rotation complexity. The implementation is provided in a GitHub repository in a file named bicyclic.py.

## Source excerpt

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 "FHE packing," which I will assume as background knowledge for this article: