Function smartnoise_runtime::utilities::mechanisms::gaussian_mechanism[][src]

pub fn gaussian_mechanism(
    value: f64,
    epsilon: f64,
    delta: f64,
    sensitivity: f64,
    analytic: bool,
    enforce_constant_time: bool
) -> Result<f64>

Returns noise drawn according to the Gaussian mechanism.

If using the standard guassian, Let c = sqrt(2ln(1.25/delta)). Noise is drawn from a Gaussian distribution with scale sensitivityc/epsilon and centered about 0. For more information, see the Gaussian mechanism in C. Dwork, A. Roth The Algorithmic Foundations of Differential Privacy, Chapter 3.5.3 Laplace versus Gauss p.53. August 2014.

If using the analytic gaussian, the noise scale is derived using Balle (2018).

NOTE: this implementation of Gaussian draws in likely non-private due to floating-point attacks See Mironov (2012) for more information on a similar attack of the Laplace mechanism.

Arguments

Return

A draw from Gaussian distribution with scale defined as above.

Examples

use smartnoise_runtime::utilities::mechanisms::gaussian_mechanism;
let n = gaussian_mechanism(22.3, 0.1, 0.0001, 2.0, false, false);