void CKKSEvaluator::multiply_inplace()

in src/hit/api/evaluator.cpp [202:223]


    void CKKSEvaluator::multiply_inplace(CKKSCiphertext &ct1, const CKKSCiphertext &ct2) {
        VLOG(VLOG_EVAL) << "Multiply ciphertexts";
        if (ct1.needs_relin() || ct2.needs_relin()) {
            LOG_AND_THROW_STREAM("Inputs to multiply must be linear ciphertexts");
        }
        if (ct1.he_level() != ct2.he_level()) {
            LOG_AND_THROW_STREAM("Inputs to multiply must be at the same level: " << ct1.he_level()
                                                                                  << " != " << ct2.he_level());
        }
        if (ct1.needs_rescale() || ct2.needs_rescale()) {
            LOG_AND_THROW_STREAM("Inputs to multiply must have nominal scale");
        }
        if (ct1.scale() != ct2.scale()) {
            LOG_AND_THROW_STREAM("Inputs to multiply must have the same scale: " << log2(ct1.scale()) << " bits != "
                                                                                 << log2(ct2.scale()) << " bits");
        }
        multiply_inplace_internal(ct1, ct2);
        ct1.needs_rescale_ = true;
        ct1.needs_relin_ = true;
        ct1.scale_ *= ct1.scale_;
        print_stats(ct1);
    }