@@ -220,14 +220,46 @@ RecryptData::~RecryptData()
220220}
221221
222222
223-
224223/* *
225- * Fix the "ring constant" cM, a target norm tau for the secret key,
226- * and plaintext space mod p^r. We want to find e,e' that minimize
227- * e-e', subject to the constraint
224+ * Summary of Appendix A from https://ia.cr/2014/873 (version from 2019):
225+ * Assume that we already chosen a, e, e' and t (which induces the
226+ * secret-key size tau).
227+ *
228+ * Going into the recryption procedure after "raw mod-switching", we
229+ * have a ciphertext (c0,c1) where the ci's are "random modulo q" in
230+ * their powerful basis. Denoting x = c0+c1*s (without mod-q reduction),
231+ * then |x|< |c0|+|c1*s|< q + B*||c1*s||, where |X| is powerful-basis
232+ * norm, ||X|| is canonical embedding norm, and B is some bound on the
233+ * ratio between the two.
234+ *
235+ * Let tau be our bound on the secret key canonical-mebedding norm,
236+ * and we think of c1 as having random coefficients in [+-q/2] (say in
237+ * the powerful basis). Then ||c1|| < A*q whp (for some other bound A),
238+ * and therefore ||c1*s||< A*q*tau. Hence we get |x| < q*(1+B*A*tau).
239+ * The quantity A*B for this ring is recorded as cM in the PAlgebra,
240+ * so we have |x|/q < 1 + cM*tau < (1+tau)*cM.
228241 *
242+ * We also assume that the "noise term" after mod-q reduction is bounded
243+ * by |[x]_q| < 2*p^r*(1+tau)*cM (this expression is twice the added
244+ * noise term from mod-switching).
245+ *
246+ * After makeDivisible relative to e' and a (with a divisible by p^r),
247+ * and b = p^e'/2 -a, we have a ciphertext (c0',c1') s.t.
248+ * x' = c0'+c1'*s = x+p^r(u0+u1*s)+(v0+v1*s),
249+ * where |u0|,|u1|<a and |v0|,|v1|<b. It follows from the above that
250+ *
251+ * |x'|/q < (2+b)(1+tau)*cM, and
252+ * |[x']_q|< p^r(2+a)(1+tau)*cM
253+ *
254+ * To be able to use the Lemma 5.1 from https://ia.cr/2014/873, we
255+ * need to have |x'|/q + |[x']_q| <= (q-1)/2 = p^e/2. Using the bounds
256+ * from above, a sufficient condition for this is
257+ *
229258 * (1) (p^{e'}/2 + 2(p^r+1))(tau+1)*cM <= (q-1)/2 = p^e/2
230259 *
260+ * (This is Equation (9) in Appendix A of https://ia.cr/2014/873,
261+ * but note that the a here is a*p^r there.)
262+ *
231263 * Note that as we let e,e' tend to infinity the constraint above
232264 * degenerates to (tau+1)*cM < p^{e-e'}, so the smallest value
233265 * of e-e' that we can hope for is
@@ -242,10 +274,10 @@ RecryptData::~RecryptData()
242274 *
243275 * Once e,e' are set, it splits p^{e'}/2=a+b with a,b about equal and
244276 * a divisible by p^r. Then it computes and returns the largest Hamming
245- * weight for the key (that implies the norm tau' ) for which constraint
277+ * weight for the key (that implies the norm tau) for which constraint
246278 * (1) still holds.
247279 *
248- * NOTE: setAE returns the Hamming weight, *not* the norm tau' . The norm
280+ * NOTE: setAE returns the Hamming weight, *not* the norm tau. The norm
249281 * can be computed from the weight using sampleHWtBoundedEffectiveBound.
250282 **/
251283long RecryptData::setAE (long & a, long & e, long & ePrime,
0 commit comments