Skip to main content

DpEngine

Struct DpEngine 

Source
pub struct DpEngine { /* private fields */ }
Expand description

The DPE-RB differential privacy engine.

Manages Rényi composition tracking, chaos-modulated noise injection, and anomaly flagging for privacy budget breaches.

Implementations§

Source§

impl DpEngine

Source

pub fn new() -> Self

Source

pub fn with_config(config: DpConfig) -> Self

Source

pub fn apply_dp( &mut self, query: PrivacyQuery, chaos_perturbation: f64, ) -> Result<DpNoiseFrame, PrivacyError>

Apply differential privacy to a query result.

Injects Gaussian or Laplace noise calibrated to sensitivity and ε. Chaos modulation from oracle perturbs noise scale for adaptivity.

Source

pub fn noise_sample(&self, noise_scale: f64, chaos_seed: &[u8; 32]) -> f64

Generate a noise sample for DP injection.

Returns a noise value drawn from the configured distribution, scaled by noise_scale and modulated by chaos perturbation.

Source

pub fn check_budget(&self) -> Result<(), PrivacyError>

Check if privacy budget is approaching exhaustion.

Source

pub fn prove_compliance(&self) -> PrivacyProof

Generate a ZKP proof of DP compliance.

Source

pub fn epsilon_consumed(&self) -> f64

Returns current ε consumed.

Source

pub fn query_count(&self) -> u64

Returns total queries processed.

Source

pub fn reset_budget(&mut self)

Reset the privacy budget (governance-approved reset).

Trait Implementations§

Source§

impl Default for DpEngine

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.