1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#![doc = include_str!("../README.md")]
#![doc = include_str!("../USAGE.md")]

mod hashing;
mod ops;
mod polynomials;
mod sharing;

pub use hashing::*;
pub use polynomials::*;
pub use sharing::*;

// Re-Exports
pub use secp;
pub use sha2;

#[cfg(feature = "rand")]
pub fn random_coefficients<R: rand::RngCore + rand::CryptoRng>(
    rng: &mut R,
    n: usize,
) -> Vec<secp::MaybeScalar> {
    (0..n).map(|_| secp::Scalar::random(rng).into()).collect()
}