Add Borromean range proof verifying functionality

This commit is contained in:
Boog900
2023-06-23 12:23:33 +01:00
parent 71ffcc8ef7
commit ac30e3afaa
4 changed files with 90 additions and 18 deletions

View File

@@ -1,3 +1,4 @@
use std::fmt::Debug;
use std::io::{self, Read, Write};
use curve25519_dalek::{
@@ -143,3 +144,10 @@ pub(crate) fn read_vec<R: Read, T, F: Fn(&mut R) -> io::Result<T>>(
) -> io::Result<Vec<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>>(
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())
}