osu-crypto / libPSI

A repository for private set intersection.
Other
168 stars 47 forks source link

problem about balls to bins #25

Closed L-coder148 closed 2 years ago

L-coder148 commented 2 years ago

Hi, I have a problem about the function BallsAndBins in main.cpp, m denotes the number of bin, n is the number of balls, s is the binScaler, it satisfies m=n*binScaler , but it seems that the code auto m = n / mm in line 373 is wrong. should it be auto m = n * mm?

what's more, Given the number of the bin b, the number of balls n, and one hash function,PSZ16 shows how to get the max binsize according to Equation(3) in Page13(simple hash).

But now if I use two hash function to map n balls into b bins(simple hash). each ball appears at two bins, now if I use Equation(3) to find the max binsize, should I plug the number of balls2*n and b in the Equation(3)? because the number of hash functions is 2, therefore the real number of balls turns out to be 2*n.

Generally,if I use k hash functions(simple hash), should I plug the ballsk*n and b in the Equation(3)? suppose b is fixed.

ladnir commented 2 years ago

mm is a double so it's just matter of perspective.

Not sure about psz but yeah, if your hashing n items with k hash functions, then you have kn balls.

L-coder148 commented 2 years ago

Thank you!