# Slot-shuffling homomorphically

**URL:** <https://openfhe.discourse.group/t/slot-shuffling-homomorphically/170>\
**Category:** FHE Questions\
**Created:** [October 17, 2022, 10:51pm UTC](https://openfhe.discourse.group/t/slot-shuffling-homomorphically/170 "2022-10-17T22:51:23Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![ypolyakov](https://yyz1.discourse-cdn.com/flex031/user_avatar/openfhe.discourse.group/ypolyakov/32/47_2.png) [@ypolyakov](https://openfhe.discourse.group/u/ypolyakov)\
**Post date:** [October 23, 2022, 2:26am UTC](https://openfhe.discourse.group/t/slot-shuffling-homomorphically/170/4 "2022-10-23T02:26:24Z")

</div>

The most efficient way for performing such homomorphic arbitrary permutations that I am aware of is based on a linear transformation of an encrypted vector, where the linear map is composed of 0’s and 1’s. Two relevant papers are [Faster Homomorphic Linear Transformations in HElib](https://eprint.iacr.org/2018/244) and [Secure Outsourced Matrix Computation and Application to Neural Networks](https://eprint.iacr.org/2018/1041). The matrix arithmetic library we are adding for OpenFHE is based on some of these algorithms.

In OpenFHE, there is a function EvaLT that can be used for such linear transforms. Ar a high level, you can use rotations, multiplications by masks with 1’s and 0’s, and additions to obtain any permutation.

---

_[View the full topic](https://openfhe.discourse.group/t/slot-shuffling-homomorphically/170)._
