pub trait PackSelected: Sized {
    fn pack_selected(dst: &mut [Vec<u8>; 8], src: &[Self], selected: [usize; 8]);
    fn unpack_selected(
        dst: &mut Vec<Self>,
        src: &[&[u8]; 8],
        selected: [usize; 8]
    ); }

Required Methods

Extract and save (to dst) the shares of the selected players from the sharings. E.g. given a 2 packed sharing between 4 players: abcd|1234 Between players:

  • P_a

  • P_b

  • P_c

  • P_d

  • P_1

  • P_2

  • P_3

  • P_4

And selected = [1, 3], the destination vector will contain:

  • dst[0] = [b, ...]
  • dst[1] = [1, ...]
Arguments
  • dst: Individually serialized share for each player (one vector of results per instance).
  • src: The input sharings.
  • selected: The players whose shares should be extracted. If selected[i] >= PLAYERS no share are extracted.

Implementors