BGVβs RNS-based modulus switch is not computed by ModSwitchRNS, because BGVβs original non-RNS modulus switch (SummaryΒ D-4.7 in Β§D-4.7) is performed in a different manner than BFV or CKKSβs non-RNS modulus switch (SummaryΒ C-4.4 in Β§C-4.4). BGVβs non-RNS modulus switch is computed as follows:
# where
# where
Therefore, BGVβs RNS-based modulus switch only needs to compute the above formulas for and based on RNSβs arithmetic. In the above computations, the only part that cannot be directly computed by RNS-based operations is the rounding in and . This rounding can be performed in RNS by using , by setting and .