Open jatanloya opened 3 years ago
It seems that the db13860.enc is not being created, facing the same issue.
Hi @jatanloya the reason you are seeing this error is because gen-params.batx
only generates the algebra, public/secret keys as you mentioned and then encrypts any data you have (both database and query data).
However, it does not generate or encode any data for you and maybe this should have been mentioned in the README.md
.
You need to provide the encoded data db13860.enc
yourself. This can be done using the utilities which can be found in helib/utils
. In particular there is an example encoder/decoder python script provided there. Have a look at helib/utils/README.md
for more information on the usage.
Hope that helps.
Yep got it, I'll try encoding some data and then running the PSI test again. Thanks for the help.
@jlhcrawford Hello, after providing the encoded database and query I was able to generate parameters and encrypt the query and the database. After running the test using DEBUG=1 bats . the following error is thrown
Can you please provide a sample database, query and params for the same, will be very helpful. Thanks.
Hi @jatanloya that is an unusual error. It seems like the bats test cannot find the public key file for some reason even though you ran ./gen-params.batx
. Have you double checked that the file test_bgv.pk
exists and contains a public key?
In terms of an example database/query there is work on a PR that updates the serialisation and also contains an updated misc/psi/README.md
with some example data.
This update should happen soon-ish however in the meantime you can have a look at the current misc/psi/README.md
here https://github.com/helibproject/HElib/tree/serialization-2.0/misc/psi
Hopefully the updated documentation helps solve your problem. Let me know if you run into any additional problems.
Hello @jlhcrawford, the error was occuring due to a path mismatch which has been fixed.
We tried the example database & query on the given link but are not getting expected results and DEBUG=1 bats . also shows failure. The output are large number of random digits.
It seems that the problem is due to inappropiate parameters like nslots, n, p & m. Can you suggest these values and perhpaps tell us how to calculate them for any given data?
Also are there any resources that will have more details on how to structure data into rows and columns for the database and the query?
If you are getting numbers that can't be represented with the current parameters then you need to increase p to a prime number larger than the largest number you want to be represented.
In terms of the scoring
test this will be the final answer. To see what that number is there is a python script gen-expected-mask.py
that does the same operations in the clear.
Finding the p that gives you the same nslots = phi(m)/d
can be tricky as it is determined by d
in the equation p^d mod m == 1
.
What parameters are you using in the gen-params.batx
script?
The example data I provided is intended to work with "toy parameters". So nslots = 3, p = 13 etc. the function that generates these parameters is create-toy-lookup-params
in gen-params.batx
so if you comment out line 88 and uncomment line 87 then you can use the "toy parameters".
Note: when making the above change, ensure that the variables modulus
and nslots
in scoring.bats
and lookup.bats
are the same as the p
and nslots
generated in the test_bgv.info
file.
Environment: macOS Catalina Version: 10.15.7 (19H2)
Description: While running the ./gen-params.batx -f "generate params" command, the following error is being thrown, the script is creating a temp folder with .info,.params, .pk, .sk files.