Is it possible to trim some encrypted values under fully homomorphic encryption Suppose we have $N$ encrypted values under homomorphic encryption (BFV/BGV ..), and we know that $M$ of them are below $t$. Is it possible to remove those $M$ values?
It is known that some methods (e.g. homomorphic comparison) can out put $N$ encrypted $1$ or $0$s denoting whether the value is above $t$ or not, but I need to crop those below $t$, leaving $N-M$ encrypted values.
Edit: I understand it's not possible to directly remove the $M$ values, but is it possible to output $N-M$ new encrypted values, whose plaintext is exactly those $N-M$ values above $t$.
As long as you can design a circuit to do it, then yes. There are a few ways to do this. One is to build a sorting network and output the highest $N-M$ values.