# HeMat
An method for HE matrices multiplication and transpose.
A matrix is encoded in slots as a long vector i.e., concating the rows.
Matrix multiplication/transpose computation use linear transformation to permute the slots.
$A\cdot B=\sum_{k=1}^d A_k\odot B_k$ where $A_k$ and $B_k$ are permutations of $A,B$ of $\dim d$ .
$A_0$ can be computed from $A$ with $O(d)$ rotations and $A_k$ , $1\le k \le d$ can be computed with $O(1)$ rotations. Similarly applies to $B_k