in src/hit/api/evaluator/debug.cpp [25:84]
void DebugEval::print_parameters() {
VLOG(VLOG_VERBOSE) << "/";
VLOG(VLOG_VERBOSE) << "| Encryption parameters :";
VLOG(VLOG_VERBOSE) << "| scheme: CKKS";
VLOG(VLOG_VERBOSE) << "| poly_modulus_degree: " << (2 * num_slots());
/*
Print the size of the true (product) coefficient modulus.
*/
int total_bits = homomorphic_eval->context->total_modulus_bits();
stringstream coeff_modulus_size_info;
coeff_modulus_size_info << "| coeff_modulus size: " << total_bits << " (";
for (int i = 0; i < homomorphic_eval->context->num_qi(); i++) {
double bits = log2(static_cast<double>(homomorphic_eval->context->get_qi(i)));
coeff_modulus_size_info << ceil(bits) << " + ";
}
for (int i = 0; i < homomorphic_eval->context->num_pi(); i++) {
double bits = log2(static_cast<double>(homomorphic_eval->context->get_pi(i)));
coeff_modulus_size_info << ceil(bits) << " + ";
}
coeff_modulus_size_info << ") bits";
VLOG(VLOG_VERBOSE) << coeff_modulus_size_info.str();
VLOG(VLOG_VERBOSE) << "\\";
// We iterate over the chain and print the parms_id for each set of parameters.
VLOG(VLOG_VERBOSE) << "Print the modulus switching chain.";
// First print the key level parameter information.
VLOG(VLOG_VERBOSE) << "----> Level (chain index): " << homomorphic_eval->context->num_qi()
<< " ...... key_context_data()";
VLOG(VLOG_VERBOSE) << " parms_id: lvl<" << homomorphic_eval->context->num_qi() << ">";
stringstream key_level_primes;
for (int i = 0; i < homomorphic_eval->context->num_qi(); i++) {
key_level_primes << hex << homomorphic_eval->context->get_qi(i) << dec << " ";
}
for (int i = 0; i < homomorphic_eval->context->num_pi(); i++) {
key_level_primes << hex << homomorphic_eval->context->get_pi(i) << dec << " ";
}
VLOG(VLOG_VERBOSE) << " coeff_modulus primes: " << hex << key_level_primes.str() << dec;
VLOG(VLOG_VERBOSE) << "\\";
// Next iterate over the remaining (data) levels.
for (int i = homomorphic_eval->context->max_ciphertext_level(); i >= 0; i--) {
VLOG(VLOG_VERBOSE) << " \\--> Level (chain index): " << i;
if (i == homomorphic_eval->context->max_ciphertext_level()) {
VLOG(VLOG_VERBOSE) << " ...... first_context_data()";
} else if (i == 0) {
VLOG(VLOG_VERBOSE) << " ...... last_context_data()";
}
VLOG(VLOG_VERBOSE) << " parms_id: lvl<" << i << ">";
stringstream data_level_primes;
for (int j = 0; j <= i; j++) {
data_level_primes << hex << homomorphic_eval->context->get_qi(j) << dec << " ";
}
VLOG(VLOG_VERBOSE) << " coeff_modulus primes: " << data_level_primes.str();
VLOG(VLOG_VERBOSE) << "\\";
}
VLOG(VLOG_VERBOSE) << " End of chain reached";
}