TenSEAL icon indicating copy to clipboard operation
TenSEAL copied to clipboard

Max operation for 2 encrypted numbers

Open spnzig opened this issue 4 years ago • 1 comments

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

spnzig avatar Aug 18 '21 17:08 spnzig

pow on ckksvector only supports integer

youben11 avatar Aug 21 '21 07:08 youben11