ckks_engine::utils

Function add_noise

Source
pub fn add_noise(poly: &Polynomial, _pub_key: &impl Debug) -> Polynomial

The add_noise function modifies a given polynomial by adding random noise to each coefficient. This is commonly used in cryptographic schemes to enhance security by introducing uncertainty in computations.

Description

Inputs:

  • poly: A reference to the input polynomial whose coefficients will be modified.
  • _pub_key: A public key object (or any object implementing the Debug trait) for context, though unused in this implementation.

Output: A new Polynomial object with noise added to its coefficients. Noise is generated randomly for each coefficient within a small range.

Use Case: Noise addition is often applied to encrypt values or secure polynomial computations in homomorphic encryption or other cryptographic protocols.