avoid warnings

This commit is contained in:
Rasoul Akhavan Mahdavi
2025-11-05 20:38:20 -05:00
parent 18652da7e0
commit dc2d399602
3 changed files with 12 additions and 12 deletions

View File

@@ -18,26 +18,26 @@ where
{
let mut res: VecZnx<&mut [u8]> = res.to_mut();
let (n_out, n_in) = (res.n(), a[0].to_ref().n());
let (_n_out, _n_in) = (res.n(), a[0].to_ref().n());
#[cfg(debug_assertions)]
{
assert_eq!(tmp.len(), res.n());
debug_assert!(
n_out > n_in,
_n_out > _n_in,
"invalid a: output ring degree should be greater"
);
a[1..].iter().for_each(|ai| {
debug_assert_eq!(
ai.to_ref().n(),
n_in,
_n_in,
"invalid input a: all VecZnx must have the same degree"
)
});
assert!(n_out.is_multiple_of(n_in));
assert_eq!(a.len(), n_out / n_in);
assert!(_n_out.is_multiple_of(_n_in));
assert_eq!(a.len(), _n_out / _n_in);
}
a.iter().for_each(|ai| {

View File

@@ -16,27 +16,27 @@ where
let a: VecZnx<&[u8]> = a.to_ref();
let a_size = a.size();
let (n_in, n_out) = (a.n(), res[0].to_mut().n());
let (_n_in, _n_out) = (a.n(), res[0].to_mut().n());
#[cfg(debug_assertions)]
{
assert_eq!(tmp.len(), a.n());
assert!(
n_out < n_in,
_n_out < _n_in,
"invalid a: output ring degree should be smaller"
);
res[1..].iter_mut().for_each(|bi| {
assert_eq!(
bi.to_mut().n(),
n_out,
_n_out,
"invalid input a: all VecZnx must have the same degree"
)
});
assert!(n_in.is_multiple_of(n_out));
assert_eq!(res.len(), n_in / n_out);
assert!(_n_in.is_multiple_of(_n_out));
assert_eq!(res.len(), _n_in / _n_out);
}
res.iter_mut().enumerate().for_each(|(i, bi)| {