extern crate group_math as group;
pub use group::Group;
pub struct PointFn<const N: usize, const LAMBDA: usize, G>
where
G: Group<LAMBDA>,
{
pub alpha: [u8; N],
pub beta: G,
}
#[macro_export]
macro_rules! decl_prg_trait {
($ret_elem:ty) => {
#[cfg(feature = "multithread")]
pub trait Prg<const LAMBDA: usize>: Sync {
fn gen(&self, seed: &[u8; LAMBDA]) -> [$ret_elem; 2];
}
#[cfg(not(feature = "multithread"))]
pub trait Prg<const LAMBDA: usize> {
fn gen(&self, seed: &[u8; LAMBDA]) -> [$ret_elem; 2];
}
};
}
#[derive(Clone)]
pub struct Cw<const LAMBDA: usize, G>
where
G: Group<LAMBDA>,
{
pub s: [u8; LAMBDA],
pub v: G,
pub tl: bool,
pub tr: bool,
}
#[derive(Clone)]
pub struct Share<const LAMBDA: usize, G>
where
G: Group<LAMBDA>,
{
pub s0s: Vec<[u8; LAMBDA]>,
pub cws: Vec<Cw<LAMBDA, G>>,
pub cw_np1: G,
}