Closed czh-rot closed 5 months ago
Suppose Entry_i = {10,10,... , 10,... }, here I mean the data size of each entry is bigger than log(T-1), so it must use multiple slots to store an entry.
Remember, 1 isn't really 1. It's the polynomial g(x) where the constant term is 1 and all other coefficients are 0. Entry_i would be a polynomial p(x) where each coefficient is 10. p(x) = 10 + 10x + 10x^2 + 10x^3...
So we have that Enc(1 + 0x + 0x^2...) * p(x) = Enc(p(x)).
SEAL has a few different ways to encode the entries. In the original implementation, I believe we simply took the data (10, 10, 10, 10, 10) and put each 10 into a different coefficient. That's all.
In the current implementation, I think we do something slightly different. See here: https://github.com/microsoft/SealPIR/blob/ee1a5a3922fc9250f9bb4e2416ff5d02bfef7e52/src/pir_server.cpp#L39
Remember, 1 isn't really 1. It's the polynomial g(x) where the constant term is 1 and all other coefficients are 0. Entry_i would be a polynomial p(x) where each coefficient is 10. p(x) = 10 + 10x + 10x^2 + 10x^3...
So we have that Enc(1 + 0x + 0x^2...) * p(x) = Enc(p(x)).
SEAL has a few different ways to encode the entries. In the original implementation, I believe we simply took the data (10, 10, 10, 10, 10) and put each 10 into a different coefficient. That's all.
In the current implementation, I think we do something slightly different. See here:
Ah I see. Actually for encoding, the input to the construct is in the form of INTT. Sorry for the confusion because I used to construct plaintext and ciphertext in NTT. I actually just need to comment out the INTT and NTT functions from encode and decode.
First of all, I only read the papers. For simplicity, we set d to 1. For n entries (Entry_i, 0<=i<n-1), after executing expand, n ciphertexts are produced, one of which is Enc(1) and the rest is Enc(0). My question is: how is Entry_i encoded into plaintext? Suppose Entry_i = {10,10,... , 10,... } Enc(1) = Enc({1,0,0,0,0,...}) Enc(1) * Entry_i = {10,0,0,0,... } That doesn't seem to get the full value of Entry_i, right?