update MLSAG, ss2_elements will always be 2

This commit is contained in:
Boog900
2023-06-23 23:29:43 +01:00
parent c1a2aafc83
commit e4a615aa76
5 changed files with 19 additions and 27 deletions

View File

@@ -145,9 +145,9 @@ pub(crate) fn read_vec<R: Read, T, F: Fn(&mut R) -> io::Result<T>>(
read_raw_vec(f, read_varint(r)?.try_into().unwrap(), r)
}
pub(crate) fn read_64_array<R: Read, T: Debug, F: Fn(&mut R) -> io::Result<T>>(
pub(crate) fn read_array<const N: usize, R: Read, T: Debug, F: Fn(&mut R) -> io::Result<T>>(
f: F,
r: &mut R,
) -> io::Result<[T; 64]> {
(0 .. 64).map(|_| f(r)).collect::<io::Result<Vec<T>>>().map(|vec| vec.try_into().unwrap())
) -> io::Result<[T; N]> {
(0 .. N).map(|_| f(r)).collect::<io::Result<Vec<T>>>().map(|vec| vec.try_into().unwrap())
}