Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What is CIPHER_SIZE? #8

Closed
ReverseControl opened this issue Sep 25, 2020 · 2 comments
Closed

What is CIPHER_SIZE? #8

ReverseControl opened this issue Sep 25, 2020 · 2 comments

Comments

@ReverseControl
Copy link

In the file main.cpp there is this comment:

    //To marshall query to send over the network, you can use serialize/deserialize:
    //std::string query_ser = serialize_query(query);
    //PirQuery query2 = deserialize_query(d, 1, query_ser, CIPHER_SIZE);

What is CIPHER_SIZE? The number of coefficients of a ciphertext? The number of bytes? Could you please define it? A macro or function would be fine.

Also, what is the meaning of the 1? A little documentation would be helpful.

@sga001
Copy link
Contributor

sga001 commented Sep 25, 2020

Macro is defined in pir.hpp (https://github.com/microsoft/SealPIR/blob/master/pir.hpp#L10).

deserialize_query is also defined in pir.hpp:

PirQuery deserialize_query(std::uint32_t d, uint32_t count, std::string s, std::uint32_t len_ciphertext);

If my memory serves me right, d is the number of dimensions, count is the number of ciphertexts needed to encode the index in each dimension, s is the serialized query, and len_ciphertext is the size of the ciphertext in bytes.

@ReverseControl
Copy link
Author

I have:

N = 4096
q = CoeffModulus::BFVDefault( N )  (SEAL v3.5.8)
t = 257

Ciphertext cp_data;   <-- I encrypt some data, and it is stored here.

cp.int_array().size() = 16384;   <- I expected this to be twice this size.
string data_serialized =   serialize_data( cp );
data_serialized.size() = 91194;

So, should CIPHER_SIZE be 16384?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants