Trait concrete_npe::cross::Cross[][src]

pub trait Cross: Sized {
    fn external_product(
        dimension: usize,
        l_gadget: usize,
        base_log: usize,
        polynomial_size: usize,
        var_trgsw: f64,
        var_trlwe: f64
    ) -> f64;
fn bootstrap(
        lwe_dimension: usize,
        rlwe_dimension: usize,
        l_gadget: usize,
        base_log: usize,
        polynomial_size: usize,
        var_bsk: f64
    ) -> f64;
fn cmux(
        var_rlwe_0: f64,
        var_rlwe_1: f64,
        var_trgsw: f64,
        dimension: usize,
        polynomial_size: usize,
        base_log: usize,
        l_gadget: usize
    ) -> f64; }

Required methods

fn external_product(
    dimension: usize,
    l_gadget: usize,
    base_log: usize,
    polynomial_size: usize,
    var_trgsw: f64,
    var_trlwe: f64
) -> f64
[src]

fn bootstrap(
    lwe_dimension: usize,
    rlwe_dimension: usize,
    l_gadget: usize,
    base_log: usize,
    polynomial_size: usize,
    var_bsk: f64
) -> f64
[src]

fn cmux(
    var_rlwe_0: f64,
    var_rlwe_1: f64,
    var_trgsw: f64,
    dimension: usize,
    polynomial_size: usize,
    base_log: usize,
    l_gadget: usize
) -> f64
[src]

Loading content...

Implementations on Foreign Types

impl Cross for u32[src]

fn external_product(
    dimension: usize,
    l_gadget: usize,
    base_log: usize,
    polynomial_size: usize,
    var_trgsw: f64,
    var_trlwe: f64
) -> f64
[src]

Return the variance of the external product given a set of parameters. To see how to use it, please refer to the test of the external product. Arguments

  • dimension - the size of the RLWE mask
  • l_gadget - number of elements for the Torus decomposition
  • base_log - decomposition base of the gadget matrix
  • polynomial_size - number of coefficients of the polynomial e.g. degree + 1
  • var_trgsw - noise variance of the TRGSW
  • var_trlwe - noise variance of the TRLWE

Output

  • Returns the variance of the output RLWE

Warning

  • only correct for the external product inside a bootstrap

Example

use concrete_npe::Cross ;
type Torus = u32;
// settings
let dimension: usize = 3 ;
let l_gadget: usize = 4 ;
let base_log: usize = 7 ;
let polynomial_size: usize = 1024 ;
let var_trgsw: f64 = f64::powi(2., -38) ;
let var_trlwe: f64 = f64::powi(2., -40) ;
// Computing the noise
let var_external_product = <Torus as Cross>::external_product(dimension, l_gadget, base_log, polynomial_size, var_trgsw, var_trlwe) ;

fn cmux(
    var_rlwe_0: f64,
    var_rlwe_1: f64,
    var_trgsw: f64,
    dimension: usize,
    polynomial_size: usize,
    base_log: usize,
    l_gadget: usize
) -> f64
[src]

Return the variance of the cmux given a set of parameters. To see how to use it, please refer to the test of the cmux. Arguments

  • var_rlwe_0 - noise variance of the first TRLWE
  • var_rlwe_1 - noise variance of the second TRLWE
  • var_trgsw - noise variance of the TRGSW
  • dimension - the size of the RLWE mask
  • polynomial_size - number of coefficients of the polynomial e.g. degree + 1
  • base_log - decomposition base of the gadget matrix
  • l_gadget - number of elements for the Torus decomposition

Output

  • Returns the variance of the output RLWE

Warning

  • only correct for the cmux inside a bootstrap

Example

use concrete_npe::Cross ;
type Torus = u32;
// settings
let dimension: usize = 3 ;
let l_gadget: usize = 4 ;
let base_log: usize = 7 ;
let polynomial_size: usize = 1024 ;
let var_trgsw: f64 = f64::powi(2., -38) ;
let var_trlwe_0: f64 = f64::powi(2., -40) ;
let var_trlwe_1: f64 = f64::powi(2., -40) ;
// Computing the noise
let var_cmux = <Torus as Cross>::cmux(var_trlwe_0, var_trlwe_1, var_trgsw,  dimension, polynomial_size, base_log, l_gadget) ;

fn bootstrap(
    lwe_dimension: usize,
    rlwe_dimension: usize,
    l_gadget: usize,
    base_log: usize,
    polynomial_size: usize,
    var_bsk: f64
) -> f64
[src]

Return the variance of output of a bootstrap given a set of parameters. To see how to use it, please refer to the test of the bootstrap. Arguments

  • lwe_dimension - size of the LWE mask
  • rlwe_dimension - size of the RLWE mask
  • l_gadget - number of elements for the Torus decomposition
  • dimension - the size of the RLWE mask
  • base_log - decomposition base of the gadget matrix
  • polynomial_size - number of coefficients of the polynomial e.g. degree + 1
  • var_bsk - variance of the bootstrapping key

Output

  • Returns the variance of the output RLWE

Example

use concrete_npe::Cross ;
type Torus = u32;
// settings
let rlwe_dimension: usize = 3 ;
let lwe_dimension: usize = 630 ;
let l_gadget: usize = 4 ;
let base_log: usize = 7 ;
let polynomial_size: usize = 1024 ;
let var_bsk: f64 = f64::powi(2., -38) ;
// Computing the noise
let var_bootstrap = <Torus as Cross>::bootstrap(lwe_dimension, rlwe_dimension, l_gadget, base_log, polynomial_size, var_bsk) ;

impl Cross for u64[src]

fn external_product(
    dimension: usize,
    l_gadget: usize,
    base_log: usize,
    polynomial_size: usize,
    var_trgsw: f64,
    var_trlwe: f64
) -> f64
[src]

Return the variance of the external product given a set of parameters. To see how to use it, please refer to the test of the external product. Arguments

  • dimension - the size of the RLWE mask
  • l_gadget - number of elements for the Torus decomposition
  • base_log - decomposition base of the gadget matrix
  • polynomial_size - number of coefficients of the polynomial e.g. degree + 1
  • var_trgsw - noise variance of the TRGSW
  • var_trlwe - noise variance of the TRLWE

Output

  • Returns the variance of the output RLWE

Warning

  • only correct for the external product inside a bootstrap

Example

use concrete_npe::Cross ;
type Torus = u64;
// settings
let dimension: usize = 3 ;
let l_gadget: usize = 4 ;
let base_log: usize = 7 ;
let polynomial_size: usize = 1024 ;
let var_trgsw: f64 = f64::powi(2., -38) ;
let var_trlwe: f64 = f64::powi(2., -40) ;
// Computing the noise
let var_external_product = <Torus as Cross>::external_product(dimension, l_gadget, base_log, polynomial_size, var_trgsw, var_trlwe) ;

fn cmux(
    var_rlwe_0: f64,
    var_rlwe_1: f64,
    var_trgsw: f64,
    dimension: usize,
    polynomial_size: usize,
    base_log: usize,
    l_gadget: usize
) -> f64
[src]

Return the variance of the cmux given a set of parameters. To see how to use it, please refer to the test of the cmux. Arguments

  • var_rlwe_0 - noise variance of the first TRLWE
  • var_rlwe_1 - noise variance of the second TRLWE
  • var_trgsw - noise variance of the TRGSW
  • dimension - the size of the RLWE mask
  • polynomial_size - number of coefficients of the polynomial e.g. degree + 1
  • base_log - decomposition base of the gadget matrix
  • l_gadget - number of elements for the Torus decomposition

Output

  • Returns the variance of the output RLWE

Warning

  • only correct for the cmux inside a bootstrap

Example

use concrete_npe::Cross ;
type Torus = u64;
// settings
let dimension: usize = 3 ;
let l_gadget: usize = 4 ;
let base_log: usize = 7 ;
let polynomial_size: usize = 1024 ;
let var_trgsw: f64 = f64::powi(2., -38) ;
let var_trlwe_0: f64 = f64::powi(2., -40) ;
let var_trlwe_1: f64 = f64::powi(2., -40) ;
// Computing the noise
let var_cmux = <Torus as Cross>::cmux(var_trlwe_0, var_trlwe_1, var_trgsw,  dimension, polynomial_size, base_log, l_gadget) ;

fn bootstrap(
    lwe_dimension: usize,
    rlwe_dimension: usize,
    l_gadget: usize,
    base_log: usize,
    polynomial_size: usize,
    var_bsk: f64
) -> f64
[src]

Return the variance of output of a bootstrap given a set of parameters. To see how to use it, please refer to the test of the bootstrap. Arguments

  • lwe_dimension - size of the LWE mask
  • rlwe_dimension - size of the RLWE mask
  • l_gadget - number of elements for the Torus decomposition
  • dimension - the size of the RLWE mask
  • base_log - decomposition base of the gadget matrix
  • polynomial_size - number of coefficients of the polynomial e.g. degree + 1
  • var_bsk - variance of the bootstrapping key

Output

  • Returns the variance of the output RLWE

Example

use concrete_npe::Cross ;
type Torus = u64;
// settings
let rlwe_dimension: usize = 3 ;
let lwe_dimension: usize = 630 ;
let l_gadget: usize = 4 ;
let base_log: usize = 7 ;
let polynomial_size: usize = 1024 ;
let var_bsk: f64 = f64::powi(2., -38) ;
// Computing the noise
let var_bootstrap = <Torus as Cross>::bootstrap(lwe_dimension, rlwe_dimension, l_gadget, base_log, polynomial_size, var_bsk) ;
Loading content...

Implementors

Loading content...