betteryao/BetterYao5-hbc.cpp
void BetterYao5::generate_input_keys(Prng & prng, std::vector<Bytes> & dest, uint32_t num_keys, uint32_t num_bits){
  Bytes key;
  int j;
  for(j=0;j<num_keys;j++){
    // generate the key (so that it is the right size)
    key = prng.rand_bits(num_bits);
    // set the permutation bit. evens are 0, odds are 1
    //    key.set_ith_bit(0, j%2);
    dest.push_back(key);
  }

}
/**
   inputs: reference to Prng, location where keys will be stores, number of keys
   the length of the key is determined by the security parameter K
   we use a prng for repeatable results
   note that even keys are given semantic value 0 and odd keys are given semantic value 1
*/
reference to Prng, location where keys will be stores, number of keys
the length of the key is determined by the security parameter K
we use a prng for repeatable results
note that even keys are given semantic value 0 and odd keys are given semantic value 1
reference to Prng location where keys will be stores number of keys the length of the key is determined by the security parameter K we use a prng for repeatable results note that even keys are given semantic value 0 and odd keys are given semantic value 1
void BetterYao5::generate_input_keys(Prng & prng, std::vector<Bytes> & dest, uint32_t num_keys, uint32_t num_bits){
  Bytes key;
  int j;
  for(j=0;j<num_keys;j++){
    key = prng.rand_bits(num_bits);
    dest.push_back(key);
  }
}
void BetterYao5 :: generate_input_keys ( Prng & prng , std :: vector < Bytes > & dest , uint32_t num_keys , uint32_t num_bits ) { Bytes key ; int j ; for ( j = 0 ; j < num_keys ; j ++ ) { key = prng . rand_bits ( num_bits ) ; dest . push_back ( key ) ; } }
inputs: reference to Prng, location where keys will be stores, number of keys
the length of the key is determined by the security parameter K
we use a prng for repeatable results
note that even keys are given semantic value 0 and odd keys are given semantic value 1
inputs : reference to Prng location where keys will be stores number of keys the length of the key is determined by the security parameter K we use a prng for repeatable results note that even keys are given semantic value 0 and odd keys are given semantic value 1
// generate the key (so that it is the right size) // set the permutation bit. evens are 0, odds are 1 //    key.set_ith_bit(0, j%2);