mirror of
https://github.com/arnaucube/phantom-zone.git
synced 2026-01-10 16:11:30 +01:00
modfiy benches a bit
This commit is contained in:
@@ -85,7 +85,7 @@ fn benchmark(c: &mut Criterion) {
|
|||||||
let a1 = (&mut rng).sample_iter(dist).take(ring_size).collect_vec();
|
let a1 = (&mut rng).sample_iter(dist).take(ring_size).collect_vec();
|
||||||
let a2 = (&mut rng).sample_iter(dist).take(ring_size).collect_vec();
|
let a2 = (&mut rng).sample_iter(dist).take(ring_size).collect_vec();
|
||||||
|
|
||||||
let d = 2;
|
let d = 1;
|
||||||
let a0_matrix = (0..d)
|
let a0_matrix = (0..d)
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.map(|_| (&mut rng).sample_iter(dist).take(ring_size).collect_vec())
|
.map(|_| (&mut rng).sample_iter(dist).take(ring_size).collect_vec())
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ fn benchmark(c: &mut Criterion) {
|
|||||||
.sample_iter(Uniform::new(0, prime))
|
.sample_iter(Uniform::new(0, prime))
|
||||||
.take(ring_size)
|
.take(ring_size)
|
||||||
.collect_vec();
|
.collect_vec();
|
||||||
let d = 3;
|
let d = 2;
|
||||||
let a_matrix = (0..d)
|
let a_matrix = (0..d)
|
||||||
.map(|_| {
|
.map(|_| {
|
||||||
(&mut rng)
|
(&mut rng)
|
||||||
|
|||||||
@@ -103,9 +103,9 @@ mod test {
|
|||||||
// let mut stats = Stats::new();
|
// let mut stats = Stats::new();
|
||||||
|
|
||||||
for _ in 0..1000 {
|
for _ in 0..1000 {
|
||||||
let now = std::time::Instant::now();
|
// let now = std::time::Instant::now();
|
||||||
let c_out = evaluator.xor(&c_m0, &c_m1, &runtime_server_key);
|
let c_out = evaluator.xor(&c_m0, &c_m1, &runtime_server_key);
|
||||||
println!("Gate time: {:?}", now.elapsed());
|
// println!("Gate time: {:?}", now.elapsed());
|
||||||
|
|
||||||
// mp decrypt
|
// mp decrypt
|
||||||
let decryption_shares = cks
|
let decryption_shares = cks
|
||||||
|
|||||||
@@ -192,7 +192,7 @@ pub(crate) fn pbs<
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// let now = std::time::Instant::now();
|
let now = std::time::Instant::now();
|
||||||
// blind rotate
|
// blind rotate
|
||||||
blind_rotation(
|
blind_rotation(
|
||||||
&mut trivial_rlwe_test_poly,
|
&mut trivial_rlwe_test_poly,
|
||||||
@@ -208,7 +208,7 @@ pub(crate) fn pbs<
|
|||||||
pbs_info,
|
pbs_info,
|
||||||
pbs_key,
|
pbs_key,
|
||||||
);
|
);
|
||||||
// println!("Blind rotation time: {:?}", now.elapsed());
|
println!("Blind rotation time: {:?}", now.elapsed());
|
||||||
|
|
||||||
// sample extract
|
// sample extract
|
||||||
sample_extract(lwe_in, &trivial_rlwe_test_poly, pbs_info.modop_rlweq(), 0);
|
sample_extract(lwe_in, &trivial_rlwe_test_poly, pbs_info.modop_rlweq(), 0);
|
||||||
@@ -372,7 +372,7 @@ fn blind_rotation<
|
|||||||
mod_op,
|
mod_op,
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
// println!("Auto count: {count}");
|
println!("Auto count: {count}");
|
||||||
}
|
}
|
||||||
|
|
||||||
fn mod_switch_odd(v: f64, from_q: f64, to_q: f64) -> usize {
|
fn mod_switch_odd(v: f64, from_q: f64, to_q: f64) -> usize {
|
||||||
|
|||||||
Reference in New Issue
Block a user