core_utils/preprocessing/
mod.rs1use std::fmt::Debug;
2
3use primitives::{
4 algebra::elliptic_curve::Curve,
5 sharing::{Reconstructible, VerifiableWith},
6};
7use serde::{de::DeserializeOwned, Serialize};
8use wincode::{SchemaRead, SchemaWrite};
9
10use crate::{circuit::Circuit, preprocessing::iterator::CerberusPreprocessingIterator};
11
12pub mod batching;
13#[cfg(any(test, feature = "dev"))]
14pub mod dealer;
15pub mod errors;
16pub mod iterator;
17pub mod source;
18
19pub trait Preprocessing:
23 Debug
24 + Sized
25 + Send
26 + Sync
27 + Clone
28 + PartialEq
29 + Serialize
30 + DeserializeOwned
31 + SchemaWrite<Src = Self>
32 + for<'a> SchemaRead<'a>
33 + Reconstructible
34 + VerifiableWith<VerificationData = <Self as Preprocessing>::AssociatedData>
35{
36 type AssociatedData: Send
39 + Sync
40 + Clone
41 + PartialEq
42 + Serialize
43 + DeserializeOwned
44 + SchemaWrite<Src = Self::AssociatedData>
45 + for<'a> SchemaRead<'a, Dst = Self::AssociatedData>;
46}
47
48impl<
49 Data: Send
50 + Sync
51 + Clone
52 + PartialEq
53 + Serialize
54 + DeserializeOwned
55 + SchemaWrite<Src = Data>
56 + for<'a> SchemaRead<'a, Dst = Data>,
57 T: Debug
58 + Sized
59 + Send
60 + Sync
61 + Clone
62 + PartialEq
63 + Serialize
64 + DeserializeOwned
65 + VerifiableWith<VerificationData = Data>
66 + for<'a> wincode::SchemaRead<'a, Dst = T>
67 + wincode::SchemaWrite<Src = T>,
68 > Preprocessing for T
69{
70 type AssociatedData = Data;
71}
72
73pub trait PreprocessingBundler<C: Curve>: Send {
81 fn fetch_for(&mut self, circuit: &Circuit<C>) -> CerberusPreprocessingIterator<C>;
87}