Skip to content
This repository has been archived by the owner on Sep 27, 2023. It is now read-only.

Python client limited to k<=32 #59

Open
tkaitchuck opened this issue Jan 8, 2016 · 1 comment
Open

Python client limited to k<=32 #59

tkaitchuck opened this issue Jan 8, 2016 · 1 comment

Comments

@tkaitchuck
Copy link
Contributor

Attempting k=128 results in:
File "../tests/rappor_sim.py", line 238, in
main(sys.argv)
File "../tests/rappor_sim.py", line 231, in main
params1, params2, irr_rand, opts.assoc_testdata, csv_in, csv_out)
File "../tests/rappor_sim.py", line 121, in GenAssocTestdata
irr1 = string_encoder.encode(v1)
File "/usr/local/google/home/tkaitchuck/rappor2/rappor/client/python/rappor.py", line 335, in encode
_, _, irr = self._internal_encode(word)
File "/usr/local/google/home/tkaitchuck/rappor2/rappor/client/python/rappor.py", line 311, in _internal_encode
prr, irr = self._internal_encode_bits(bloom)
File "/usr/local/google/home/tkaitchuck/rappor2/rappor/client/python/rappor.py", line 261, in _internal_encode_bits
self.secret, to_big_endian(bits), self.params.prob_f,
File "/usr/local/google/home/tkaitchuck/rappor2/rappor/client/python/rappor.py", line 162, in to_big_endian
return struct.pack('>L', i)

trying with k=64 results in:
Traceback (most recent call last):
File "../tests/rappor_sim.py", line 238, in
main(sys.argv)
File "../tests/rappor_sim.py", line 231, in main
params1, params2, irr_rand, opts.assoc_testdata, csv_in, csv_out)
File "../tests/rappor_sim.py", line 121, in GenAssocTestdata
irr1 = string_encoder.encode(v1)
File "/usr/local/google/home/tkaitchuck/rappor2/rappor/client/python/rappor.py", line 335, in encode
_, _, irr = self._internal_encode(word)
File "/usr/local/google/home/tkaitchuck/rappor2/rappor/client/python/rappor.py", line 311, in _internal_encode
prr, irr = self._internal_encode_bits(bloom)
File "/usr/local/google/home/tkaitchuck/rappor2/rappor/client/python/rappor.py", line 262, in _internal_encode_bits
self.params.num_bloombits)
File "/usr/local/google/home/tkaitchuck/rappor2/rappor/client/python/rappor.py", line 201, in get_prr_masks
raise RuntimeError('%d bits is more than the max of %d', num_bits, len(d))
NameError: global name 'd' is not defined

@andychu
Copy link
Contributor

andychu commented Jan 12, 2016

There are two limitations on k in Python:

  1. fastrand module supporting 64 bits
  2. PRR RNG is initialized with 32 bit value

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants