0

When I compiled homomorphic multiplication using SEAL4.0, the following error was reported.

This is my c++ code.

void multiply_by_random_mask(Ciphertext &ciphertext,
                             shared_ptr<UniformRandomGenerator> random,
                             BatchEncoder &encoder,
                             Evaluator &evaluator,
                             RelinKeys &relin_keys,
                             uint64_t plain_modulus) {

    size_t slot_count = encoder.slot_count();
    vector<uint64_t> pod_vector;
    for (size_t j = 0; j < slot_count; j++) {
        pod_vector.push_back( random_nonzero_integer(random, plain_modulus));
    }
    Plaintext mask;
    encoder.encode(pod_vector, mask);
    evaluator.multiply_plain_inplace(ciphertext, mask);
    evaluator.relinearize_inplace(ciphertext, relin_keys);
}

Always output the following during compilation:

/usr/local/include/SEAL-4.0/gsl/span: In instantiation of ‘constexpr gsl::span<ElementType, Extent>::span(Container&) [with long unsigned int MyExtent = 18446744073709551615; Container = seal::Plaintext; typename std::enable_if<(((((MyExtent == gsl::dynamic_extent) && (! gsl::details::is_span<Container>::value)) && (! gsl::details::is_std_array<Container>::value)) && std::is_pointer<decltype (declval<Container&>().data())>::value) && std::is_convertible<typename std::remove_pointer<decltype (declval<Container&>().data())>::type (*)[], ElementType (*)[]>::value), int>::type <anonymous> = 0; ElementType = const long unsigned int; long unsigned int Extent = 18446744073709551615]’:
/home/ubuntu/CLionProjects/Kunlun/mpc/labelpsi/psi.cpp:434:60:   required from here
/usr/local/include/SEAL-4.0/gsl/span:491:71: error: ‘class seal::Plaintext’ has no member named ‘size’; did you mean ‘resize’?
  491 |     constexpr span(Container& cont) noexcept : span(cont.data(), cont.size())
      |                                                                  ~~~~~^~~~
      |                                                                  resize

How can I modify my code to eliminate existing errors?

wohlstad
  • 12,661
  • 10
  • 26
  • 39
kit tom
  • 21
  • 1

0 Answers0