pub struct DifferentialPrivacy {
pub noise_mechanisms: [NoiseMechanism; 2],
pub privacy_accountant: PrivacyAccountant,
pub privacy_budget: PrivacyBudget,
}Expand description
Differential-privacy release engine with explicit total budget.
Fields§
§noise_mechanisms: [NoiseMechanism; 2]§privacy_accountant: PrivacyAccountant§privacy_budget: PrivacyBudgetImplementations§
Source§impl DifferentialPrivacy
impl DifferentialPrivacy
pub fn new() -> Self
pub fn with_budget( epsilon: f64, delta: f64, composition_method: CompositionMethod, ) -> Result<Self, PrivacyError>
pub fn validate(&self) -> Result<(), PrivacyError>
Sourcepub fn release_laplace_into(
&mut self,
query_result: &[f64],
l1_sensitivity: f64,
epsilon: f64,
out: &mut [f64],
) -> Result<usize, PrivacyError>
pub fn release_laplace_into( &mut self, query_result: &[f64], l1_sensitivity: f64, epsilon: f64, out: &mut [f64], ) -> Result<usize, PrivacyError>
Release with Laplace noise drawn from operating-system cryptographic entropy.
Sourcepub fn release_laplace_with_noise_into<R: NoiseSource>(
&mut self,
query_result: &[f64],
l1_sensitivity: f64,
epsilon: f64,
noise: &mut R,
out: &mut [f64],
) -> Result<usize, PrivacyError>
pub fn release_laplace_with_noise_into<R: NoiseSource>( &mut self, query_result: &[f64], l1_sensitivity: f64, epsilon: f64, noise: &mut R, out: &mut [f64], ) -> Result<usize, PrivacyError>
Release a vector-valued query with Laplace noise calibrated to L1 sensitivity.
Custom sources are useful for deterministic tests. A source that is not a CSPRNG invalidates the differential-privacy guarantee.
Sourcepub fn release_gaussian_into(
&mut self,
query_result: &[f64],
l2_sensitivity: f64,
epsilon: f64,
delta: f64,
out: &mut [f64],
) -> Result<usize, PrivacyError>
pub fn release_gaussian_into( &mut self, query_result: &[f64], l2_sensitivity: f64, epsilon: f64, delta: f64, out: &mut [f64], ) -> Result<usize, PrivacyError>
Release with Gaussian noise drawn from operating-system cryptographic entropy.
Sourcepub fn release_gaussian_with_noise_into<R: NoiseSource>(
&mut self,
query_result: &[f64],
l2_sensitivity: f64,
epsilon: f64,
delta: f64,
noise: &mut R,
out: &mut [f64],
) -> Result<usize, PrivacyError>
pub fn release_gaussian_with_noise_into<R: NoiseSource>( &mut self, query_result: &[f64], l2_sensitivity: f64, epsilon: f64, delta: f64, noise: &mut R, out: &mut [f64], ) -> Result<usize, PrivacyError>
Release a vector-valued query with the classic calibrated Gaussian mechanism.
This sufficient calibration is valid for 0 < epsilon <= 1 and 0 < delta < 1:
σ = sensitivity * sqrt(2 ln(1.25 / δ)) / ε.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DifferentialPrivacy
impl RefUnwindSafe for DifferentialPrivacy
impl Send for DifferentialPrivacy
impl Sync for DifferentialPrivacy
impl Unpin for DifferentialPrivacy
impl UnsafeUnpin for DifferentialPrivacy
impl UnwindSafe for DifferentialPrivacy
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
Aggregate shares in an MPC protocol.
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> NoneValue for Twhere
T: Default,
impl<T> NoneValue for Twhere
T: Default,
type NoneType = T
§fn null_value() -> T
fn null_value() -> T
The none-equivalent value.