MCPcopy Create free account
hub / github.com/data61/MP-SPDZ / sample

Method sample

FHE/DiscreteGauss.cpp:20–31  ·  view source on GitHub ↗

This uses the approximation to a Gaussian via * binomial distribution * * This procedure consumes 2*NewHopeB bits * */

Source from the content-addressed store, hash-verified

18 *
19 */
20int DiscreteGauss::sample(PRNG &G, int stretch) const
21{
22 int s= 0;
23 // stretch refers to the standard deviation
24 int B = NewHopeB * stretch * stretch;
25 for (int i = 0; i < B; i++)
26 {
27 s += G.get_bit();
28 s -= G.get_bit();
29 }
30 return s;
31}
32
33
34

Callers 2

generate_ciphertextsMethod · 0.45
getMethod · 0.45

Calls 1

get_bitMethod · 0.45

Tested by

no test coverage detected