Trait MultiPuncPrf

Source
pub trait MultiPuncPrf<const N: usize, K, Pk, Y> {
    // Required methods
    fn setup<R>(&self, rng: &mut R) -> K
       where R: Rng + ?Sized;
    fn punc(&self, k: &K, ss: &[usize]) -> Pk;
    fn eval(&self, ks: &Pk, x: usize) -> Option<Y>;

    // Provided method
    fn f(&self, k: &K, x: usize) -> Option<Y> { ... }
}
Expand description

MF. API of multi-puncturable PRF. Refers to t-Punc-PRF with an addtional property. $t(\cdot)$ is a fixed polynomial.

  • Generic parameter K is for the PRF key.
  • Generic parameter Pk is for the punctured key.
  • Generic parameter Y is for $\mathcol{Y}$.
  • $\mathcol{X}$ is $[N]$ where N is the provided generic parameter.

Required Methods§

Source

fn setup<R>(&self, rng: &mut R) -> K
where R: Rng + ?Sized,

MF.Setup.

Returns a description (i.e., the structure or representation) of a PRF key.

Source

fn punc(&self, k: &K, ss: &[usize]) -> Pk

MF.Punc.

  • k is the PRF key.
  • ss is a set of elements S s.t. $|S| \le t(\lambda)$.

Returns a punctured key.

Source

fn eval(&self, ks: &Pk, x: usize) -> Option<Y>

MF.Eval.

  • ks is the punctured key.
  • x is the evaluated point. $x \in [2^LOGN]$.

Returns Y if $x \notin S$ otherwise None.

Provided Methods§

Source

fn f(&self, k: &K, x: usize) -> Option<Y>

F.

It works like kp = punc(k, []) then eval(kp, x), which is the default implementation. Provided for possible optimization. Or say this is the actual start point.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<const LAMBDA: usize, const N: usize, KD> MultiPuncPrf<N, GgmPrfKey<LAMBDA>, GgmPuncKey<LAMBDA>, [u8; LAMBDA]> for GgmMultiPuncPrf<LAMBDA, N, KD>
where KD: GgmKeyDerive<LAMBDA>,