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

chore(docs): fix README link to getting started #1479

Merged
merged 3 commits into from
Aug 19, 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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ To run this code, use the following command:
> Note that when running code that uses `TFHE-rs`, it is highly recommended
to run in release mode with cargo's `--release` flag to have the best performances possible.

*Find an example with more explanations in [this part of the documentation](https://docs.zama.ai/tfhe-rs/getting-started/quick_start)*
*Find an example with more explanations in [this part of the documentation](https://docs.zama.ai/tfhe-rs/get-started/quick_start)*

<p align="right">
<a href="#about" > ↑ Back to top </a>
Expand Down
21 changes: 7 additions & 14 deletions apps/trivium/src/kreyvium/kreyvium.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,9 @@ where

/// Computes one turn of the stream, updating registers and outputting the new bit.
pub fn next_bool(&mut self) -> T {
match &self.fhe_key {
Some(sk) => set_server_key(sk.clone()),
None => (),
};
if let Some(sk) = &self.fhe_key {
set_server_key(sk.clone());
}

let [o, a, b, c] = self.get_output_and_values(0);

Expand Down Expand Up @@ -226,18 +225,12 @@ where
/// Computes 64 turns of the stream, outputting the 64 bits all at once in a
/// Vec (first value is oldest, last is newest)
pub fn next_64(&mut self) -> Vec<T> {
match &self.fhe_key {
Some(sk) => {
rayon::broadcast(|_| set_server_key(sk.clone()));
}
None => (),
if let Some(sk) = &self.fhe_key {
rayon::broadcast(|_| set_server_key(sk.clone()));
}
let mut values = self.get_64_output_and_values();
match &self.fhe_key {
Some(_) => {
rayon::broadcast(|_| unset_server_key());
}
None => (),
if self.fhe_key.is_some() {
rayon::broadcast(|_| unset_server_key());
}

let mut ret = Vec::<T>::with_capacity(64);
Expand Down
14 changes: 4 additions & 10 deletions apps/trivium/src/kreyvium/kreyvium_byte.rs
Original file line number Diff line number Diff line change
Expand Up @@ -237,18 +237,12 @@ where
/// Computes 64 turns of the stream, outputting the 64 bits (in 8 bytes) all at once in a
/// Vec (first value is oldest, last is newest)
pub fn next_64(&mut self) -> Vec<T> {
match &self.fhe_key {
Some(sk) => {
rayon::broadcast(|_| set_server_key(sk.clone()));
}
None => (),
if let Some(sk) = &self.fhe_key {
rayon::broadcast(|_| set_server_key(sk.clone()));
}
let values = self.get_64_output_and_values();
match &self.fhe_key {
Some(_) => {
rayon::broadcast(|_| unset_server_key());
}
None => (),
if self.fhe_key.is_some() {
rayon::broadcast(|_| unset_server_key());
}

let mut bytes = Vec::<T>::with_capacity(8);
Expand Down
21 changes: 7 additions & 14 deletions apps/trivium/src/trivium/trivium_bool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,9 @@ where

/// Computes one turn of the stream, updating registers and outputting the new bit.
pub fn next_bool(&mut self) -> T {
match &self.fhe_key {
Some(sk) => set_server_key(sk.clone()),
None => (),
};
if let Some(sk) = &self.fhe_key {
set_server_key(sk.clone());
}

let [o, a, b, c] = self.get_output_and_values(0);

Expand Down Expand Up @@ -196,18 +195,12 @@ where
/// Computes 64 turns of the stream, outputting the 64 bits all at once in a
/// Vec (first value is oldest, last is newest)
pub fn next_64(&mut self) -> Vec<T> {
match &self.fhe_key {
Some(sk) => {
rayon::broadcast(|_| set_server_key(sk.clone()));
}
None => (),
if let Some(sk) = &self.fhe_key {
rayon::broadcast(|_| set_server_key(sk.clone()));
}
let mut values = self.get_64_output_and_values();
match &self.fhe_key {
Some(_) => {
rayon::broadcast(|_| unset_server_key());
}
None => (),
if self.fhe_key.is_some() {
rayon::broadcast(|_| unset_server_key());
}

let mut ret = Vec::<T>::with_capacity(64);
Expand Down
14 changes: 4 additions & 10 deletions apps/trivium/src/trivium/trivium_byte.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,18 +187,12 @@ where
/// Computes 64 turns of the stream, outputting the 64 bits (in 8 bytes) all at once in a
/// Vec (first value is oldest, last is newest)
pub fn next_64(&mut self) -> Vec<T> {
match &self.fhe_key {
Some(sk) => {
rayon::broadcast(|_| set_server_key(sk.clone()));
}
None => (),
if let Some(sk) = &self.fhe_key {
rayon::broadcast(|_| set_server_key(sk.clone()));
}
let values = self.get_64_output_and_values();
match &self.fhe_key {
Some(_) => {
rayon::broadcast(|_| unset_server_key());
}
None => (),
if self.fhe_key.is_some() {
rayon::broadcast(|_| unset_server_key());
}

let mut bytes = Vec::<T>::with_capacity(8);
Expand Down
2 changes: 1 addition & 1 deletion tfhe/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ rayon = { version = "1.5.0" }
bincode = "1.3.3"
concrete-fft = { version = "0.4.1", features = ["serde", "fft128"] }
concrete-ntt = { version = "0.1.2" }
pulp = "0.18.8"
pulp = "0.18.22"
tfhe-cuda-backend = { version = "0.4.0-alpha.0", path = "../backends/tfhe-cuda-backend", optional = true }
aligned-vec = { version = "0.5", features = ["serde"] }
dyn-stack = { version = "0.9" }
Expand Down
2 changes: 1 addition & 1 deletion tfhe/benches/shortint/oprf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ fn oprf(c: &mut Criterion) {
let keys = KEY_CACHE.get_from_param(param);
let sks = keys.server_key();

bench_group.bench_function(&format!("2-bits-oprf::{}", param.name()), |b| {
bench_group.bench_function(format!("2-bits-oprf::{}", param.name()), |b| {
b.iter(|| {
_ = black_box(sks.generate_oblivious_pseudo_random(Seed(0), 2));
})
Expand Down
2 changes: 1 addition & 1 deletion toolchain.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
nightly-2024-07-05
nightly-2024-08-19
Loading