Let pi coprime positive integers for i=1,...,K.
Let ai be an integer satisfying 0≤ai<pi for each i.
The Chinese Remainder Theorem (CRT) provides a way to determine an integer
a such that:
a=a1modp1
...
a=aKmodpK
To determine a, we proceed as follows. Define:
P=p1⋯pK
Pi=piP
ti=Pi−1modpi
The value a can be constructed as:
a=i=1∑KtiPiai
It’s clear that a=aimodpi because
tiPiai=1ai=aimodpi
and
tiPiai=0modpjfori≠j
The value a is unique up to modulo P, but we do not know the integer r
for which:
rP≤a<(r+1)P
For example, in lattice-based cryptography, the integer a is
sometimes represented as (a1,...,aK) for performance reasons.
However, at some point, one needs to reconstruct a
from (a1,...,aK). In these cases, ∣a∣<P (in fact, ∣a∣<2P because
the values are centered around 0). So, how can we reconstruct a?