English

Packing Entries to Diagonals for Homomorphic Sparse-Matrix Vector Multiplication

Cryptography and Security 2026-04-07 v1 Data Structures and Algorithms

Abstract

Homomorphic encryption (HE) enables computation over encrypted data but incurs a substantial overhead. For sparse-matrix vector multiplication, the widely used Halevi and Shoup (2014) scheme has a cost linear in the number of occupied cyclic diagonals, which may be many due to the irregular nonzero pattern of the matrix. In this work, we study how to permute the rows and columns of a sparse matrix so that its nonzeros are packed into as few cyclic diagonals as possible. We formalise this as the two-dimensional diagonal packing problem (2DPP), introduce the two-dimensional circular bandsize metric, and give an integer programming formulation that yields optimal solutions for small instances. For large matrices, we propose practical ordering heuristics that combine graph-based initial orderings - based on bandwidth reduction, anti-bandwidth maximisation, and spectral analysis - and an iterative-improvement-based optimization phase employing 2OPT and 3OPT swaps. We also introduce a dense row/column elimination strategy and an HE-aware cost model that quantifies the benefits of isolating dense structures. Experiments on 175 sparse matrices from the SuiteSparse collection show that our ordering-optimisation variants can reduce the diagonal count by 5.5×5.5\times on average (45.6×45.6\times for one instance). In addition, the dense row/column elimination approach can be useful for cases where the proposed permutation techniques are not sufficient; for instance, in one case, the additional elimination helped to reduce the encrypted multiplication cost by 23.7×23.7\times whereas without elimination, the improvement was only 1.9×1.9\times.

Keywords

Cite

@article{arxiv.2604.04683,
  title  = {Packing Entries to Diagonals for Homomorphic Sparse-Matrix Vector Multiplication},
  author = {Kemal Mutluergil and Deniz Elbek and Kamer Kaya and Erkay Savaş},
  journal= {arXiv preprint arXiv:2604.04683},
  year   = {2026}
}

Comments

44 pages, 6 figures, 5 tables, 4 algorithms

R2 v1 2026-07-01T11:55:19.725Z