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

add homomorphic operation support for encrypted tensors #13

Closed
4 tasks done
serengil opened this issue Dec 12, 2023 · 1 comment
Closed
4 tasks done

add homomorphic operation support for encrypted tensors #13

serengil opened this issue Dec 12, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@serengil
Copy link
Owner

serengil commented Dec 12, 2023

  • Encrypt & decrypt tensors with float items
  • Homomorphic operations such add addition, element-wise multiplication, scalar multiplication and xor
  • Homomorphic multiplication (dot product) will not work because it requires addition and multiplication meanwhile and this cannot be done with PHE.
  • Tensor should be 1D vectors and all items must be int or float. We will handle multi-dimensional vectors (tensors) in a separate PR.

To encrypt & decrypt floats, we may adopt one of these approaches:

Option 1: Store Dividend and Divisor Separately

Pros:

Exact Representation: This method allows you to exactly represent the original value without loss of precision. You store the dividend and divisor separately, allowing for precise arithmetic operations during decryption.

Cons:

Increased Storage: Storing both the dividend and divisor separately may require more storage compared to the second option, where you only need to store a single integer.

Complexity: Managing two separate values might add complexity to your implementation. You need to make sure that the operations are performed correctly during encryption and decryption.

Option 2: Multiply and Divide by a Fixed Factor

Pros:

Simplicity: This method is simpler to implement, as you only need to multiply and divide by a fixed factor. This reduces the complexity of your code.

Reduced Storage: You only need to store a single integer value, which can save storage space compared to storing both the dividend and divisor separately.

Cons:

Loss of Precision: Multiplying and dividing by a fixed factor can lead to a loss of precision. If your fixed factor is not large enough, you may encounter rounding errors during encryption and decryption.

Limited Range: Depending on the fixed factor, you might have a limited range for the values you can represent in your encrypted tensor.

@serengil
Copy link
Owner Author

Closed after PR - #16

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

No branches or pull requests

1 participant