Closed ldwaiwai closed 10 years ago
The PlaintextArray class is mostly useful for debugging, you can find examples of working with it in TestGeneral.cpp, and examples of working without it in some of the other Test... programs. A typical code fragment (not using PlaintextArray) would look like this:
// ... Set the context, secretKey, and publicKey
EncryptedArray ea(context);
Ctxt c(publicKey); // a new empty ciphertext
vector<long> v1;
ea.random(v1); // random values in the slots
v1[ea.size()-1] = 1; // set the last plaintext slot to one
ea.encrypt(c, publicKey, v1); // encrypt in c the integers from v1
vector<long> v2;
ea.decrypt(c, secretKey, v2); // decrypt c into v2
hi, I was read the Design and Implementation of a Homomorphic-Encryption Library.Yet I don't know it well the difference and connection between Plaintext slots and PlaintextArray. Is there some paper to help understand the concepts?