void ChooserEncryptor::decrypt(const ChooserPoly &encrypted, ChooserPoly &destination) const
 {
     if (encrypted.comp_ == nullptr)
     {
         throw invalid_argument("encrypted has null operation history");
     }
     destination.reset();
     destination.max_abs_value() = encrypted.max_abs_value();
     destination.max_coeff_count() = encrypted.max_coeff_count();
 }
 void ChooserEncoder::encode(BigUInt value, ChooserPoly &destination)
 {
     BigPoly value_poly = encoder_.encode(value);
     destination.reset();
     destination.max_coeff_count() = value_poly.significant_coeff_count();
     destination.max_abs_value() = poly_infty_norm_coeffmod(value_poly, encoder_.plain_modulus());
 }
Example #3
0
 void ChooserEncoder::encode(BigUInt value, ChooserPoly &destination)
 {
     Plaintext value_poly;
     encoder_.encode(value, value_poly);
     destination.reset();
     destination.max_coeff_count() = value_poly.significant_coeff_count();
     destination.max_abs_value() = poly_infty_norm_coeffmod(
         value_poly.data(), value_poly.coeff_count(), encoder_.plain_modulus());
 }