Max operation for 2 encrypted numbers

Open
#313 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
cpp, python
Domain
cryptography

Research direction

Start by reproducing the CKKSVector pow() call shown in the issue and compare it with the supported integer exponent signature. Read the homomorphic operation interfaces involved in CKKSVector and determine what change, if any, would be needed to support this max calculation. Done means the requested operation has a documented, tested path or the limitation is clearly documented.

Written by the indexing model from the issue text.

Description

Type: Question :grey_question:

How to calculate the max of two homomorphically encrypted numbers.

If 'a' and 'b' are two numbers, then I can find max using the below
x = (a + b) * 0.5
y =(a - b) * 0.5
z = sqrt(y * y)

As sqrt function is not supported, I tried converting it to power
z = (y * y) power (0.5)

But I get an error.

TypeError: pow(): incompatible function arguments. The following argument types are supported:
    1. (self: _tenseal_cpp.CKKSVector, arg0: int) -> _tenseal_cpp.CKKSVector

Invoked with: <_tenseal_cpp.CKKSVector object at 0x0000012E7741AE68>, 0.5

Is there any way to solve this?

image

Dominant language
C++
Stars
1k
Forks
175
Avg merge
6d 12h
Merged PRs (30d)
5

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from OpenMined/TenSEAL

All issues in OpenMined/TenSEAL

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.