PSF

Trait PSF 

Source
pub trait PSF {
    type A;
    type Trapdoor;
    type Domain;
    type Range;

    // Required methods
    fn trap_gen(&self) -> (Self::A, Self::Trapdoor);
    fn samp_d(&self) -> Self::Domain;
    fn samp_p(
        &self,
        a: &Self::A,
        r: &Self::Trapdoor,
        u: &Self::Range,
    ) -> Self::Domain;
    fn f_a(&self, a: &Self::A, sigma: &Self::Domain) -> Self::Range;
    fn check_domain(&self, sigma: &Self::Domain) -> bool;
}
Expand description

This trait should be implemented by all constructions that are actual implementations of a preimage sampleable function. A formal definition for these PSFs can be found in [1]

Required Associated Types§

Required Methods§

Source

fn trap_gen(&self) -> (Self::A, Self::Trapdoor)

Samples a parity-check matrix and a trapdoor for that matrix.

Returns the parity-check matrix and the trapdoor.

Source

fn samp_d(&self) -> Self::Domain

Samples an element in the domain according to a specified distribution.

Returns the sampled element.

Source

fn samp_p( &self, a: &Self::A, r: &Self::Trapdoor, u: &Self::Range, ) -> Self::Domain

Samples an element e in the domain according to a specified distribution conditioned on f_a(a, e) = u.

Parameters:

  • a: The parity-check matrix
  • r: The G-Trapdoor for a
  • u: The syndrome from the range

Returns a sample e from the domain on the conditioned discrete Gaussian distribution f_a(a,e) = u.

Source

fn f_a(&self, a: &Self::A, sigma: &Self::Domain) -> Self::Range

Implements the efficiently computable function f_a, which is uniquely classified by a.

Parameters:

  • a: The parity-check matrix of dimensions n x m
  • sigma: A column vector of length m

Returns the result of f_a.

Source

fn check_domain(&self, sigma: &Self::Domain) -> bool

Checks whether an element is in the correct domain (and not just the correct type).

Returns the result of the check as a boolean.

Implementors§