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

A aggregation function for an encrypted vector (add_many/multiply_many) #74

Closed
Christopher-Wang opened this issue Jun 16, 2020 · 4 comments · Fixed by #76
Closed

A aggregation function for an encrypted vector (add_many/multiply_many) #74

Christopher-Wang opened this issue Jun 16, 2020 · 4 comments · Fixed by #76
Labels
Priority: 2 - High 😰 Should be fixed as quickly as possible, ideally within the current or following sprint Type: New Feature ➕ Introduction of a completely new addition to the codebase

Comments

@Christopher-Wang
Copy link
Contributor

Feature Description

A single encrypted TenSEAL vector should be able to be naively aggregated by either a sum or product.

Is your feature request related to a problem?

This would be especially useful for common operations such as dot product and euclidean distance.

What alternatives have you considered?

Currently the only known method I understand might for summation work is to perform a matrix multiplication with an identity vector which is not ideal.

Additional Context

Ideally the operation would look something like
encrypted_vec.add_many()

@Christopher-Wang Christopher-Wang added the Type: New Feature ➕ Introduction of a completely new addition to the codebase label Jun 16, 2020
@youben11
Copy link
Member

youben11 commented Jun 16, 2020

Hi @Christopher-Wang and thanks for your input!

I just want to clarify your feature request, so by encrypted_vec.add_many() do you mean summing up the slots of the vector? like if you have a vector encrypting the vector [1, 2, 3], this method will result in a vector encrypting a single value ([6]), is that right?

@Christopher-Wang
Copy link
Contributor Author

Christopher-Wang commented Jun 16, 2020

Yes. Similar to the Evaluator::multiply_many and Evaluator::add_many definitions in the SEAL 2.0 documentation. I also check and currently there is no way to encrypt a matrix therefore the matmul workaround is impossible. What steps do you think need to be followed to include that functionality?

@youben11
Copy link
Member

Evaluator::multiply_many and Evaluator::add_many actually do the operations on many ciphertexts in an element-wise fashion, and not on the slots of the same ciphertext.

If what you meant is the feature I described in my last comment, it shouldn't be a big deal to implement, it just wasn't a priority, but since there is a need for that, I can take a look at it and ping you when a PR is ready, you can also help us with reviews to let us know if the API for doing those operations looks good. Does this work for you?

@Christopher-Wang
Copy link
Contributor Author

Christopher-Wang commented Jun 16, 2020

I do mean the feature in your last comment. Perfect thanks! I appreciate it.

@youben11 youben11 added Priority: 2 - High 😰 Should be fixed as quickly as possible, ideally within the current or following sprint Type: New Feature ➕ Introduction of a completely new addition to the codebase and removed Type: New Feature ➕ Introduction of a completely new addition to the codebase labels Jun 16, 2020
@youben11 youben11 mentioned this issue Jun 17, 2020
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: 2 - High 😰 Should be fixed as quickly as possible, ideally within the current or following sprint Type: New Feature ➕ Introduction of a completely new addition to the codebase
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants