pryvx 2.3.0__py3-none-any.whl → 2.4.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pryvx/phe.py +13 -1
- {pryvx-2.3.0.dist-info → pryvx-2.4.0.dist-info}/METADATA +1 -1
- {pryvx-2.3.0.dist-info → pryvx-2.4.0.dist-info}/RECORD +6 -6
- {pryvx-2.3.0.dist-info → pryvx-2.4.0.dist-info}/LICENSE +0 -0
- {pryvx-2.3.0.dist-info → pryvx-2.4.0.dist-info}/WHEEL +0 -0
- {pryvx-2.3.0.dist-info → pryvx-2.4.0.dist-info}/top_level.txt +0 -0
pryvx/phe.py
CHANGED
@@ -61,4 +61,16 @@ class PHE:
|
|
61
61
|
n, _ = public_key
|
62
62
|
n2 = n * n
|
63
63
|
c2_inv = mod_inverse(c2, n2)
|
64
|
-
return (c1 * c2_inv) % n2
|
64
|
+
return (c1 * c2_inv) % n2
|
65
|
+
|
66
|
+
@staticmethod
|
67
|
+
def homomorphic_scalar_mult(ciphertext, scalar, public_key):
|
68
|
+
n, g = public_key
|
69
|
+
n2 = n * n
|
70
|
+
return pow(ciphertext, scalar, n2)
|
71
|
+
|
72
|
+
@staticmethod
|
73
|
+
def homomorphic_div(ciphertext, divisor, public_key):
|
74
|
+
n, g = public_key
|
75
|
+
divisor_inv = mod_inverse(divisor, n) # Find the modular inverse of the divisor modulo n
|
76
|
+
return PHE.homomorphic_scalar_mult(ciphertext, divisor_inv, public_key)
|
@@ -2,13 +2,13 @@ pryvx/__init__.py,sha256=A6GcpkYgwgf_HOrneIhGs3iTsiEyvd9vYEMsmrMUqWQ,89
|
|
2
2
|
pryvx/fl_client.py,sha256=p8QPlv5-CjTCwfzN0QkPr7bjKJEbU3c9Aa3HhpvZNJE,677
|
3
3
|
pryvx/fl_server.py,sha256=9fUqZfA9RZOe0fM7FYnk_8qLNw6VMj-x8tzeGXZpgKA,890
|
4
4
|
pryvx/gdp.py,sha256=-HK3Xml-huOdfz2SSmBvpgca0iU9-RwCiaD6ZyMq7bY,408
|
5
|
-
pryvx/phe.py,sha256=
|
5
|
+
pryvx/phe.py,sha256=NLYaLFCNN5aQfL0kC1YTUi962e930p2ae5dw3flJ0qo,2178
|
6
6
|
pryvx/pryvx_pb2.py,sha256=-ce40VMW0nQcjyhAJy1BvI32wtWNm425LSIExspK_qg,1200
|
7
7
|
pryvx/pryvx_pb2_grpc.py,sha256=pRQKblTNIVEwHsMQmhC-HGJFzsLh0sdOzQ-ksFYVK-A,2437
|
8
8
|
pryvx/psi.py,sha256=V0BUJwYfiFWhKtEL27q45yxY7U-I7B4olKQhaGbgN50,1346
|
9
9
|
pryvx/smpc.py,sha256=FZcE3gZo8WUVPmcBHSgP8iOkWt3AKcBLSLCtKczy8hs,2247
|
10
|
-
pryvx-2.
|
11
|
-
pryvx-2.
|
12
|
-
pryvx-2.
|
13
|
-
pryvx-2.
|
14
|
-
pryvx-2.
|
10
|
+
pryvx-2.4.0.dist-info/LICENSE,sha256=pbIMXbaorAIVW-fDch2tvtZRkVA3mz-UnXQqeCf4LDg,1086
|
11
|
+
pryvx-2.4.0.dist-info/METADATA,sha256=PhZ10Rw7ngp_mhVp2Au9YED-g_KMVKtHmUpDp4e0Zqg,1066
|
12
|
+
pryvx-2.4.0.dist-info/WHEEL,sha256=eOLhNAGa2EW3wWl_TU484h7q1UNgy0JXjjoqKoxAAQc,92
|
13
|
+
pryvx-2.4.0.dist-info/top_level.txt,sha256=1iHoeevu_FoFjdPg8HyMlgvHNUm1--9QEpFMaJEa4hw,6
|
14
|
+
pryvx-2.4.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|