Так я и делаю.
Для обеих операций я использую API, предоставляемый следующим образом:
void saveCiphertext(Ciphertext encrypted, string filename){
ofstream ct;
ct.open(filename, ios::binary);
encrypted.save(ct);
};
Для повторной загрузки у вас есть два способа:
/*
If you can't / don't want / don't need to verify the encryption parameters
*/
Ciphertext unsafe_loadCiphertext(string filename){
ifstream ct;
ct.open(filename, ios::binary);
Ciphertext result;
result.unsafe_load(context);
return result;
};
// Verifying encryption parameters
Ciphertext loadCiphertext(string filename, EncryptionParameters parms){
auto context = SEALContext::Create(parms);
ifstream ct;
ct.open(filename, ios::binary);
Ciphertext result;
result.load(context, ct);
return result;
};