I’ve been going through the bootstrapping paper and I just can’t seem to understand how they are doing the embedding in part 4.4. Does anyone have insight into what exact function they use to do this? The decoding part is clear as always but I’ve been trying to understand how they do encoding for 10 hours now with no progress. Can anyone explain this to me, or does anyone have any sources explaining it? Thank you.

I’ve taken a look at those links but they seem to only show what is ought to happen, not how that thing happens. What I mean is that I am looking for the exact algorithm that takes a vector from \mathbb{C}^{n/2} and puts it in \mathbb{Z}[x^{N/n}]/(x^N+1). I can’t seem to find this information anywhere.

CKKS encoding and decoding are expressed well in this paper (pp 4 and 5 all you need). You can adapt any FFT datapath to compute the linear transforms described on page (5).

For an implementation of that functionality, you can check CKKS packed-encoding in OpenFHE here.

To add to Caesar’s response, the short story is that you follow the same logic as in full encoding, i.e., IFFT and rounding, but use a smaller transformation corresponding to the smaller number of slots, as described in page 5 of https://eprint.iacr.org/2018/1043.pdf. The extra step you make in the sparse encoding is that you separate the entries obtained from the IFFT by a gap = N/n, which can be seen in the OpenFHE implementation (with FitToNativeVector) mentioned above, and in one of the posts referenced before.

So just to make sure I understand correctly: If I forget about the subring business and encode as usual for the subring \mathbb{Z}[Y]/(Y^n+1) and then do the seperation/viewing as a subring (Y \mapsto X^{N/n}) part I will get the correct result? And I think in the paper I linked they are using the 2l-th (in the notation of the other paper) cyclotomic polynomial are they not? The choice of primitive root confuses me and I can’t see how one would get the decoding mentioned in the original paper, i.e. the one that is just w concatenated N/n times.

Edit: I suppose 2l in the other paper is just n in the original paper.

Well encoding is the hard part so that sounds great! I don’t know much C but the implementation seems to be well commented so I will definitely try to understand it. Thank you!