qdm12 / hbc

API of homomorphic binary operations such as binary comparisons or binary divisions using the library HElib
28 stars 5 forks source link

Using the division function #4

Open Restia-Ashdoll opened 5 years ago

Restia-Ashdoll commented 5 years ago

I am currently working on a project and came across hbc, and i wanted to integrate and use the divide functions. I was however unable to figure out how to use them. I tried running the divide function in TEST_CIRC_ARITHM.cpp, but even with verbose set to true i had no idea what the inputs were and what the final answer was. May i have more clarification on how to properly use the functions?

Forgive me for my inexperience as i am quite new to this.

qdm12 commented 5 years ago

Hi Rhys!

Inputs are random numbers and the TEST acts as a unit test to verify the decrypted output matches what would be the plaintext calculation output. You should instead look at he.cpp to use the divide function (circuit) directly. Note that euclidian divisions are very limited (up to 3-4 bits numbers with GB of RAM). You could try with newer versions of HElib if there is any, but I doubt the performance will increase enough to make it interesting. Good luck!

Quentin

On Thu, Oct 25, 2018, 8:36 AM Rhys notifications@github.com wrote:

I am currently working on a project and came across hbc, and i wanted to integrate and use the divide functions. I was however unable to figure out how to use them. I tried running the divide function in TEST_CIRC_ARITHM.cpp, but even with verbose set to true i had no idea what the inputs were and what the final answer was. May i have more clarification on how to properly use the functions?

Forgive me for my inexperience as i am quite new to this.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/qdm12/hbc/issues/4, or mute the thread https://github.com/notifications/unsubscribe-auth/AO7gRL8SRv9sUcQCys6UOC-CoVmJMvY2ks5uoVvSgaJpZM4X5lk7 .

Restia-Ashdoll commented 5 years ago

I did try running directly he.cpp from the main.cpp as well, but im pretty sure im doing it wrongly. What i did was make a new HE class naming it h, HE h(); and calling the divide function by using h.DIVIDE();, but i had an error "error: no matching function for call to ‘HE::DIVIDE()’ DIVIDE();". What should i do to fix this error? ^