use blitzar::compute::*;
use curve25519_dalek::{
ristretto::{CompressedRistretto, RistrettoPoint},
scalar::Scalar,
};
use rand_core::OsRng;
fn main() {
let data: &[u16] = &[2, 3, 1, 5, 4, 7, 6, 8, 9, 10];
let mut rng = OsRng;
let gs: Vec<RistrettoPoint> = (0..data.len())
.map(|_| RistrettoPoint::random(&mut rng))
.collect();
let mut commitments = vec![CompressedRistretto::default(); 1];
compute_curve25519_commitments_with_generators(&mut commitments, &[data.into()], &gs);
let expected_commit: RistrettoPoint =
data.iter().zip(gs).map(|(d, g)| Scalar::from(*d) * g).sum();
println!("Computed Commitment: {:?}\n", commitments[0]);
println!("Expected Commitment: {:?}\n", expected_commit.compress());
}