mirror of
https://github.com/zama-ai/tfhe-rs.git
synced 2026-01-09 14:47:56 -05:00
chore: fix new clippy lints
This commit is contained in:
@@ -146,8 +146,7 @@ fn build_branches(
|
||||
build_branches(
|
||||
content,
|
||||
&(RegExpr::Seq {
|
||||
re_xs: std::iter::repeat(*repeat_re.clone())
|
||||
.take(std::cmp::max(1, at_least))
|
||||
re_xs: std::iter::repeat_n(*repeat_re.clone(), std::cmp::max(1, at_least))
|
||||
.collect(),
|
||||
}),
|
||||
c_pos,
|
||||
|
||||
@@ -294,7 +294,10 @@ fn encrypt_data<T: AsRef<[u8]>>(input: T, client_key: Option<&ClientKey>) -> Vec
|
||||
.iter()
|
||||
.copied()
|
||||
.chain(iter::once(0x80))
|
||||
.chain(iter::repeat(0x00).take(if remainder == 0 { 0 } else { 64 - remainder }))
|
||||
.chain(std::iter::repeat_n(
|
||||
0x00,
|
||||
if remainder == 0 { 0 } else { 64 - remainder },
|
||||
))
|
||||
.chain(((len * 8) as u64).to_be_bytes());
|
||||
|
||||
ArrayChunks::<_, 4>::new(bytes_iter)
|
||||
|
||||
@@ -41,7 +41,7 @@ fn pad_sha256_data(data: &[u8]) -> Vec<bool> {
|
||||
|
||||
// Calculate the number of padding zeros required
|
||||
let padding_zeros = (512 - ((bits.len() + 64) % 512)) % 512;
|
||||
bits.extend(std::iter::repeat(false).take(padding_zeros));
|
||||
bits.extend(std::iter::repeat_n(false, padding_zeros));
|
||||
|
||||
// Append a 64-bit big-endian representation of the original message length
|
||||
let data_len_bits = (data.len() as u64) * 8;
|
||||
|
||||
Reference in New Issue
Block a user