Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can this be extended to add more columns to sum? #5

Open
dougwatson opened this issue Sep 6, 2019 · 1 comment
Open

How can this be extended to add more columns to sum? #5

dougwatson opened this issue Sep 6, 2019 · 1 comment

Comments

@dougwatson
Copy link

Where in the code should I look to extend functionality to sum more than one column?

One value to sum:
"MbeI4RGJhnYcqk91Xap3NBhVtJ5vlxrn",610
"M9S1ih1nkN1EWDJG4V6e1a3MxkF9SESc",654
"pDrMne6gHAgdQVjlG0mihiHbf7qmbCpd",214

Two values to sum:
"MbeI4RGJhnYcqk91Xap3NBhVtJ5vlxrn",610,12
"M9S1ih1nkN1EWDJG4V6e1a3MxkF9SESc",654,41
"pDrMne6gHAgdQVjlG0mihiHbf7qmbCpd",214,321

@karnseth
Copy link
Collaborator

Hey Doug,
There's a couple of ways you could do this:

Currently the protocol sends along a single Paillier ciphertext that encrypts just one associated value. You could change this to allow multiple associated ciphertexts. This would involve changing EncryptedElement in match.proto to include multiple associated values. Additionally, you would have to change the server and client to populate the multiple fields, and also to homomorphically sum them.

The other way is to continue to use a single field, but to encode the two associated values as a single integer value. You could do this by reserving the higher order 32 bits as the first value and the lower order 32 bits as the second value. It's easy to implement this version by shifting and adding the two associated values together. You would have to be careful that the values don't overflow 32 bits after summing, though. Otherwise the lower order sum could corrupt the higher order sum or viceversa.

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

No branches or pull requests

2 participants