divviup_client/
dp_strategy.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
use num_bigint::BigUint;
use num_rational::Ratio;
use serde::{Deserialize, Serialize};

#[derive(Serialize, Deserialize, Debug, Clone, Eq, PartialEq, Default)]
#[serde(tag = "dp_strategy")]
#[non_exhaustive]
pub enum Prio3Histogram {
    #[default]
    NoDifferentialPrivacy,
    PureDpDiscreteLaplace(PureDpDiscreteLaplace),
}

#[derive(Serialize, Deserialize, Debug, Clone, Eq, PartialEq, Default)]
#[serde(tag = "dp_strategy")]
#[non_exhaustive]
pub enum Prio3SumVec {
    #[default]
    NoDifferentialPrivacy,
    PureDpDiscreteLaplace(PureDpDiscreteLaplace),
}

#[derive(Serialize, Deserialize, Debug, Clone, Eq, PartialEq)]
pub struct PureDpDiscreteLaplace {
    pub budget: PureDpBudget,
}

#[derive(Serialize, Deserialize, Debug, Clone, Eq, PartialEq)]
pub struct PureDpBudget {
    pub epsilon: Ratio<BigUint>,
}