crate-crypto / rust-eth-kzg

Apache License 2.0
13 stars 5 forks source link

Consider creating a bench/test_utils crate #153

Open kevaundray opened 2 months ago

kevaundray commented 2 months ago

A lot of the benchmark code needs to create random polynomials, blobs, etc -- we can group all of this into a test_utils/bench_utils crate to avoid deduplication

kevaundray commented 2 months ago

Most notably, remove deduplication on:

fn random_scalars(size: usize) -> Vec<Scalar> {
    let mut scalars = Vec::with_capacity(size);
    for _ in 0..size {
        scalars.push(Scalar::random(&mut rand::thread_rng()))
    }
    scalars
}
fn random_g1_points(size: usize) -> Vec<G1Projective> {
    let mut points = Vec::with_capacity(size);
    for _ in 0..size {
        points.push(G1Projective::random(&mut rand::thread_rng()))
    }
    points
}