One problem of the FastBConv (i.e., the fast base conversion) operation is that it creates a non-negligible noise. Specifically, suppose we use FastBConv to convert the base of (where moduli) into (where moduli), where integer . Then, the noise generated by this conversion is between and . To reduce this noise, we will explain the small Montgomery algorithm (SmallMont) which reduces the noise generated by fast base conversion from to , such that . The small Montgomery algorithm is designed as follows:
Summary D-5.7 Fast Modulo Reduction: SmallMont
Input: # is a prime and co-prime to , where
, where # where and integer
Main Steps
Output: # without
The output satisfies the relation: (where )
Proof.
# substituting
# by canceling out and
Since , this implies that is a multiple of (i.e., is exactly divisible by ). This also implies that is an integer.
# by substituting
# by substituting
# by rewriting as (where is some integer representing the -overflows of )
# since
# taking out the common multiple
The above computation result is guaranteed to be an integer (as we proved in the proof step 1). And and are co-prime (by the input definition). This leads to the conclusion that
is guaranteed to be an integer. Therefore, if we choose (i.e., a prime and co-prime to both and ) as a sufficiently large value, then will converge to . This is because as increases: (1) grows slower than (since ); (2) the magnitude of stays smaller than (as integer ); and (3) is guaranteed to be an integer between . In conclusion, if is sufficiently large, then we get the following relation:
# where
Also, the following is true:
# because divides and is co-prime to
Notice that by using SmallMont in Summary D-5.7, the accuracy of the raw output of (where integer ) is improved to (where ) as follows:
# where