Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parallel iteration #354

Merged
merged 1 commit into from
Feb 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions sunscreen_tfhe/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ num = { workspace = true }
paste = { workspace = true }
rand = { workspace = true }
rand_distr = { workspace = true }
rayon = { workspace = true }
realfft = "3.3.0"
rustfft = "6.1.0"
serde = { workspace = true }
Expand Down
39 changes: 37 additions & 2 deletions sunscreen_tfhe/benches/ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use sunscreen_tfhe::{
entities::{
GgswCiphertext, GgswCiphertextFft, GlweCiphertext, Polynomial, UnivariateLookupTable,
},
high_level::*,
high_level::{self, *},
ops::bootstrapping::circuit_bootstrap,
rand::Stddev,
GlweDef, GlweDimension, GlweSize, LweDef, LweDimension, PlaintextBits, PolynomialDegree,
Expand Down Expand Up @@ -226,10 +226,45 @@ fn circuit_bootstrapping(c: &mut Criterion) {
});
}

fn keygen(c: &mut Criterion) {
c.bench_function("LWE Secret keygen", |b| {
b.iter(|| {
let _ = high_level::keygen::generate_binary_lwe_sk(&LWE_512_80);
})
});

c.bench_function("GLWE Secret keygen", |b| {
b.iter(|| {
let _ = high_level::keygen::generate_binary_glwe_sk(&GLWE_5_256_80);
})
});

let radix = RadixDecomposition {
count: RadixCount(2),
radix_log: RadixLog(16),
};

c.bench_function("BSK keygen", |b| {
let lwe_sk = high_level::keygen::generate_binary_lwe_sk(&LWE_512_80);
let glwe_sk = high_level::keygen::generate_binary_glwe_sk(&GLWE_5_256_80);

b.iter(|| {
let _ = high_level::keygen::generate_bootstrapping_key(
&lwe_sk,
&glwe_sk,
&LWE_512_80,
&GLWE_5_256_80,
&radix,
);
})
});
}

criterion_group!(
benches,
cmux,
programmable_bootstrapping,
circuit_bootstrapping
circuit_bootstrapping,
keygen
);
criterion_main!(benches);
Loading
Loading