# CKKS Part4: CKKS的乘法和重线性化

## 密文-密文乘法

$Decrypt\left( c,s \right).Decrypt\left( c',s \right)=\left( c_{0}+c_{1}.s \right).\left( c_{0}'+c_{1}'.s \right)=c_{0}.c_{0}'+\left( c_{0}.c_{1}'+c_{0}'.c_{1} \right).s+c_{1}.c_{1}'.s^{2}=d_{0}+d_{1}.s+d_{2}.s^{2}$

$Decrypt\left( \left( d_{0}',d_{1}' \right),s \right)=Decrypt\left( \left( d_{0},d_{1},s \right) \right)+Decrypt\left( P,s \right)=d_{0}+d_{1}.s+d_{2}.s^{2}$

$\frac{Decrypt\left( evk,s \right)}{p}=\; \frac{e_{0}+p.s^{2}}{p}约等于s^{2}$

，因此最后我们使得：$$P=\left\lfloor p^{-1}.d_{2}.evk \right\rfloor\left( \mbox{mod}\ q \right)$$，这意味着我们将除以p并将其四舍五入到最接近的整数，然后使用模q（而不是p.q）。

$Decrypt\left( P,s \right)=p^{-1}.d_{2}.e_{0}+d_{2}.s^{2}约等于d_{2}.s^{2}$

，因为$$p^{-1}.d_2.e_0$$很小，可以约去！

1、相乘：$$c_{m\mu lt}=\mbox{C}_{Mult}\left( c,c' \right)=\left( d_{0},d_{1},d_{2} \right)$$
2、重线性化：$$c_{\mbox{re}lin}=\mbox{Re}lin\left( \left( d_{0},d_{1},d_{2} \right),evk \right)$$
3、解密输出：$$u_{m\mu lt}=Decrypt\left( c_{\mbox{re}lin},s \right)约等于u.u'$$

posted @ 2022-02-06 17:47  PamShao  阅读(3220)  评论(2编辑  收藏  举报