CRT reconstruction inside a prime-power ring #
Li and Liu [LL24] garble arithmetic over ℤ/N for N = ∏ i, m i with pairwise coprime
moduli m i (typically prime powers) channel by channel, through the Chinese remainder theorem.
Their bit decomposition for ℤ/N merges the channels with CRT constants in a linear
bit-composition gate, followed by an exact remainder by N. With the standard CRT coefficients
c i = M i * (M i⁻¹ mod m i), M i = N / m i, the residues x % m i determine x mod N as the
public linear combination ∑ i, c i * (x % m i) reduced modulo N (crtSum_modEq).
The combination is computed in a larger ring ℤ/p^(2k+1) with N ^ 2 ≤ p ^ k. It does not wrap
around there: each coefficient is below N (crtCoeff_lt) and the residues add up to at most
N - 1 (Nat.sum_sub_one_le_prod_sub_one), so the combination is at most (N - 1) ^ 2
(crtSum_le_sq). The exact remainder gadget of ConstantDivision then recovers x mod N in the
ring (constMod_crtSum).
Source mapping (ePrint 2023/1584 version of [LL24], dated 2023-10-13). Section 5
(pp. 23–24) takes N = ∏ i, p_i ^ k_i and constants c_i with x = ∑ i, c_i * x^(i) mod N for
the residues x^(i) = x mod p_i ^ k_i (p. 23). Its bit decomposition for ℤ/N feeds the bits of
the residues into the linear bit-composition gate over ℤ/p^(2k+1), where p ^ k > N ^ 2 exceeds
the combination, and then applies mod*_N (pp. 23–24). Here the moduli m i are any positive
pairwise coprime numbers rather than prime powers, the constants are the standard coefficients
crtCoeff, crtSum_le_sq proves the bound on the combination that the source asserts, and the
hypothesis is N ^ 2 ≤ p ^ k. The combination is computed on natural numbers: the linear
bit-composition gadget and the garbled per-channel circuits are not part of this file.
Main definitions #
Cslib.Crypto.Garbling.Arithmetic.crtCoeff: the CRT coefficient of a channel.Cslib.Crypto.Garbling.Arithmetic.crtSum: the linear combination of the channel residues.
Main results #
Cslib.Crypto.Garbling.Arithmetic.crtSum_modEq: the combination isxmoduloN.Cslib.Crypto.Garbling.Arithmetic.crtSum_le_sq: the combination is at most(N - 1) ^ 2.Cslib.Crypto.Garbling.Arithmetic.constMod_crtSum: reconstruction ofx mod Ninℤ/p^(2k+1)from the channel residues ofx.
References #
Reconstruction in ℤ/p^(2k+1): if (∏ i, m i) ^ 2 ≤ p ^ k, the remainder gadget
constMod applied to the CRT combination of the residues of x returns x mod ∏ i, m i.