Is there an easier way to grab the output of the lwe mod switching without reading the body and mask separately and reconstructing them both back into a LweCiphertextOwned?
//mod switch LWE ciphertext modulus to 2N
println!("Mod switching LWE ciphertext modulus to 2N...");
let log_modulus = params.polynomial_size.to_blind_rotation_input_modulus_log();
let (pbs_key, ..) = server_key.clone().into_raw_parts();
let pbs_key_impl = pbs_key.into_raw_parts();
let lazy_msed_ct = match pbs_key_impl.atomic_pattern {
AtomicPatternServerKey::Standard(key_ap) => match key_ap.bootstrapping_key {
ShortintBootstrappingKey::Classic {
bsk: _,
modulus_switch_noise_reduction_key,
} => modulus_switch_noise_reduction_key
.lwe_ciphertext_modulus_switch::<u64, Vec<u64>>(
&lwe_ciphertext_in,
log_modulus,
),
_ => {
unimplemented!();
}
},
_ => {
unimplemented!();
}
};
let lwe_ms_mask = lazy_msed_ct.mask();
let lwe_ms_body = lazy_msed_ct.body();