-
Notifications
You must be signed in to change notification settings - Fork 314
Open
Labels
Description
Hi,
In the code below, I tested the equality comparison between the ciphertext of 96 and the sum of 96 ones, but I found that no matter how I adjusted it, the result was always false. This was true for both unchecked_equal and equal.
'''
#[test]
fn test_basic() {
let (client_key, server_key) = gen_keys(V1_4_PARAM_MESSAGE_7_CARRY_0_KS_PBS_GAUSSIAN_2M128);
let msg1 = 96u64;
let msg2 = 1u64;
let msg3 = 0u64;
let ct_1 = client_key.encrypt(msg1);
let ct_2 = client_key.encrypt(msg2);
let ct_3 = client_key.encrypt(msg3);
let mut ct_4 = ct_3.clone();
let add_start = Instant::now();
for _i in 0..96{
server_key.unchecked_add_assign(&mut ct_4, &ct_2);
}
let add_time = add_start.elapsed();
println!("add time: {:?}", add_time);
let equal_start = Instant::now();
let ctbool = server_key.unchecked_equal(&ct_1, &ct_4);
let equal_time = equal_start.elapsed();
println!("equal time: {:?}", equal_time);
let output = client_key.decrypt(&ct_4);
println!("add expected {}, found {}", 96, output);
let result = client_key.decrypt(&ctbool);
println!("equal expected {}, found {}", true, result);
}
'''
Reactions are currently unavailable