Paper 2025/1957

Fast Batch Matrix Multiplication in Ciphertexts

Jung Hee Cheon, Seoul National University, CryptoLab Inc.
Minsik Kang, Korea Institute for Advanced Study
Junho Lee, Seoul National University
Abstract

Encrypted matrix multiplication (MM) is a fundamental primitive in privacy-preserving machine learning and encrypted data search, but it remains a significant performance bottleneck. Recently, Bae et al.~(Crypto’24) and Park~(Eurocrypt’25) introduced novel algorithms for ciphertext–plaintext (CPMM) and ciphertext–ciphertext (CCMM) matrix multiplications. These algorithms reduce encrypted MM operations to plaintext matrix multiplications (PPMM), enabling implementation through highly optimized BLAS libraries. While these reduction-based methods offer significant improvements, their benefit is limited to scenarios where the matrix dimension $d$ is comparable to the ring dimension $N$ in RLWE-based CKKS schemes. As a result, they fall short for matrix multiplications involving small or medium-sized matrices. We extend the reduction-based CPMM/CCMM into small-sized matrix operations by batching instances. We encode a batch of matrices into a single matrix over algebraic integers, where each entry is obtained by applying the inverse Discrete Fourier Transform to the batch matrix entries at the same position. This encoding enables reductions of encrypted batch MM algorithms to a small number of batch PPMMs, which can be efficiently accelerated by BLAS libraries. Our batch encrypted MM flexibly accommodates diverse matrix dimensions and batch sizes independent of the ring dimension $N$, thereby extending its applicability to practical real-world settings. For two $d \times d$ matrices with $N/d$ batches, our batch CPMM and CCMM algorithms achieve $O(d^2N)$ cost, improving over Bae et al.'s $O(dN^2)$ and Jiang et al.'s $O(d^2N\log N)$~(CCS'18). We further extend our techniques to rectangular matrices, achieving $O(dN^2)$ for multiplying a $d \times N$ matrix by an $N \times N$ matrix, improving previous $O(N^3)$ methods. A proof-of-concept implementation validates these improvements: multiplying 128 batches of $64 \times 64$ matrices takes $0.20$s (CPMM) and $1.08$s (CCMM), yielding $240\times$ and $52\times$ speedups over previous methods. For a $64 \times 2048$ by $2048 \times 2048$ multiplication, our CCMM completes in $7.5$s, achieving a $29\times$ speedup compared to Park's algorithm.

Metadata
Available format(s)
PDF
Category
Public-key cryptography
Publication info
A minor revision of an IACR publication in CRYPTO 2026
Keywords
Homomorphic EncryptionEncrypted Matrix MultiplicationCiphertext Matrix Transpose
Contact author(s)
jhcheon @ snu ac kr
minsik kang0503 @ gmail com
abab9579 @ snu ac kr
History
2026-06-09: last of 5 revisions
2025-10-20: received
See all versions
Short URL
https://ia.cr/2025/1957
License
Creative Commons Attribution
CC BY

BibTeX

@misc{cryptoeprint:2025/1957,
      author = {Jung Hee Cheon and Minsik Kang and Junho Lee},
      title = {Fast Batch Matrix Multiplication in Ciphertexts},
      howpublished = {Cryptology {ePrint} Archive, Paper 2025/1957},
      year = {2025},
      url = {https://eprint.iacr.org/2025/1957}
}
Note: In order to protect the privacy of readers, eprint.iacr.org does not use cookies or embedded third party content.