PBS statistics
use tfhe::prelude::*;
use tfhe::*;
pub fn main() {
// Config and key generation
let config = ConfigBuilder::default().build();
let (cks, sks) = generate_keys(config);
// Encryption
let a = FheUint32::encrypt(42u32, &cks);
let b = FheUint32::encrypt(16u32, &cks);
// Set the server key
set_server_key(sks);
// Compute and get the PBS count for the 32 bits multiplication
let c = &a * &b;
let mul_32_count = get_pbs_count();
// Reset the PBS count, and get the PBS count for a 32 bits bitwise AND
reset_pbs_count();
let d = &a & &b;
let and_32_count = get_pbs_count();
// Display the result
println!("mul_32_count: {mul_32_count}");
println!("and_32_count: {and_32_count}");
}
Last updated
Was this helpful?