chore(ci): fix lints for new nightly toolchain

This commit is contained in:
Arthur Meyre
2024-08-19 14:36:58 +02:00
parent 3f318a2046
commit 68e4ac4896
5 changed files with 23 additions and 49 deletions

View File

@@ -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);
@@ -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);

View File

@@ -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);

View File

@@ -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);
@@ -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);

View File

@@ -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);

View File

@@ -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));
})