pub mod authenticated;
pub mod reconstructible;
pub mod threat_model;
pub mod unauthenticated;
use std::{
fmt::Debug,
ops::{Add, Neg, Sub},
};
pub use authenticated::*;
pub use reconstructible::Reconstructible;
use serde::{de::DeserializeOwned, Serialize};
pub use threat_model::*;
pub use unauthenticated::*;
use wincode::{SchemaRead, SchemaWrite};
pub trait SecretShare:
Reconstructible
+ PlaintextOps<<Self as Reconstructible>::Value>
+ Clone
+ Debug
+ Send
+ Sync
+ 'static
+ PartialEq
+ Serialize
+ DeserializeOwned
+ SchemaWrite<Src = Self>
+ for<'de> SchemaRead<'de, Dst = Self>
+ for<'a> Add<&'a Self, Output = Self>
+ for<'s> Sub<&'s Self, Output = Self>
+ Neg<Output = Self>
{
}
impl<T> SecretShare for T where
T: Reconstructible
+ PlaintextOps<<Self as Reconstructible>::Value>
+ Clone
+ Debug
+ Send
+ Sync
+ 'static
+ PartialEq
+ Serialize
+ DeserializeOwned
+ SchemaWrite<Src = Self>
+ for<'de> SchemaRead<'de, Dst = Self>
+ for<'a> Add<&'a Self, Output = Self>
+ for<'a> Sub<&'a Self, Output = Self>
+ Neg<Output = Self>
{
}
pub trait PlaintextOps<Plaintext = <Self as Reconstructible>::Value>: Reconstructible {
fn add_plaintext(self, ptx: &Plaintext, is_first_peer: bool) -> Self;
fn sub_plaintext(self, ptx: &Plaintext, is_first_peer: bool) -> Self;
}