use std::fmt::Debug;
use primitives::{
algebra::elliptic_curve::Curve,
sharing::{Reconstructible, VerifiableWith},
};
use serde::{de::DeserializeOwned, Serialize};
use wincode::{SchemaRead, SchemaWrite};
use crate::{
circuit::Circuit,
preprocessing::{errors::PreprocessingBundlerError, iterator::CerberusPreprocessingIterator},
};
#[cfg(any(test, feature = "dev"))]
pub mod dealer;
pub mod errors;
pub mod iterator;
pub trait Preprocessing:
Debug
+ Sized
+ Send
+ Sync
+ Clone
+ PartialEq
+ Serialize
+ DeserializeOwned
+ SchemaWrite<Src = Self>
+ for<'a> SchemaRead<'a>
+ Reconstructible
+ VerifiableWith<VerificationData = <Self as Preprocessing>::AssociatedData>
{
type AssociatedData: Send
+ Sync
+ Clone
+ PartialEq
+ Serialize
+ DeserializeOwned
+ SchemaWrite<Src = Self::AssociatedData>
+ for<'a> SchemaRead<'a, Dst = Self::AssociatedData>;
}
impl<
Data: Send
+ Sync
+ Clone
+ PartialEq
+ Serialize
+ DeserializeOwned
+ SchemaWrite<Src = Data>
+ for<'a> SchemaRead<'a, Dst = Data>,
T: Debug
+ Sized
+ Send
+ Sync
+ Clone
+ PartialEq
+ Serialize
+ DeserializeOwned
+ VerifiableWith<VerificationData = Data>
+ for<'a> wincode::SchemaRead<'a, Dst = T>
+ wincode::SchemaWrite<Src = T>,
> Preprocessing for T
{
type AssociatedData = Data;
}
#[allow(async_fn_in_trait)]
pub trait PreprocessingBundler<C: Curve>: Send {
async fn fetch_for(
&mut self,
circuit: &Circuit<C>,
) -> Result<CerberusPreprocessingIterator<C>, PreprocessingBundlerError>;
}