Trait Dcf

Source
pub trait Dcf<const IN_BLEN: usize, const OUT_BLEN: usize, G>
where G: Group<OUT_BLEN>,
{ // Required methods fn gen( &self, f: &CmpFn<IN_BLEN, OUT_BLEN, G>, s0s: [&[u8; OUT_BLEN]; 2], ) -> Share<OUT_BLEN, G>; fn eval( &self, b: bool, k: &Share<OUT_BLEN, G>, xs: &[&[u8; IN_BLEN]], ys: &mut [&mut G], ); fn full_eval(&self, b: bool, k: &Share<OUT_BLEN, G>, ys: &mut [&mut G]); }
Expand description

API of distributed comparison functions (DCFs).

  • See CmpFn for IN_BLEN and OUT_BLEN.
  • See DcfImpl for the implementation.

Required Methods§

Source

fn gen( &self, f: &CmpFn<IN_BLEN, OUT_BLEN, G>, s0s: [&[u8; OUT_BLEN]; 2], ) -> Share<OUT_BLEN, G>

s0s is $s^{(0)}_0$ and $s^{(0)}_1$ which should be randomly sampled.

Source

fn eval( &self, b: bool, k: &Share<OUT_BLEN, G>, xs: &[&[u8; IN_BLEN]], ys: &mut [&mut G], )

b is the party. false is 0 and true is 1.

Source

fn full_eval(&self, b: bool, k: &Share<OUT_BLEN, G>, ys: &mut [&mut G])

Full domain eval. See Dcf::eval for b. The corresponding xs to ys is the big endian representation of 0..=u*::MAX.

Implementors§

Source§

impl<const IN_BLEN: usize, const OUT_BLEN: usize, P, G> Dcf<IN_BLEN, OUT_BLEN, G> for DcfImpl<IN_BLEN, OUT_BLEN, P>
where P: Prg<OUT_BLEN, 2>, G: Group<OUT_BLEN>,