Reduce Digits in BGV-Scheme

Hello All,

is there a way of reducing numbers by size in the BGV-Scheme.
E.g.: reducing the number 67000 to 67.
Especially reducing appending zeros.

There are three theoretically ways of achieving this:
Is there a function that reduces integers in the scheme?
Is there a mathematical formular for reducing the number of digits,
with calculating a mod inverse for a ciphertext?
Is there a way of reducing the number by manipulating the ram, reallocating the space the ciphertext needs: reducing the space from e.g. 34 bits into 30 by removing the last appending zeros.

Thanks in advance,
Maximilian

You are looking for a homomorphic rescaling operation in BGV. An approximate version of that is possible, as this work shows, but it is rather complicated. Firstly, numbers need to be represented in fixed-point representation. Secondly, you need to use BGV bootstrapping to scale down the numbers.

I would recommend using the CKKS scheme if your application requirements allow, rescaling is straightforward in CKKS and it is already implemented in OpenFHE.