pryvx 2.3.0__tar.gz → 2.4.0__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pryvx
3
- Version: 2.3.0
3
+ Version: 2.4.0
4
4
  Summary: A comprehensive package for privacy-enhancing technologies
5
5
  Home-page: UNKNOWN
6
6
  Author: PryvX (Jayesh Kenaudekar)
@@ -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)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pryvx
3
- Version: 2.3.0
3
+ Version: 2.4.0
4
4
  Summary: A comprehensive package for privacy-enhancing technologies
5
5
  Home-page: UNKNOWN
6
6
  Author: PryvX (Jayesh Kenaudekar)
@@ -1,6 +1,6 @@
1
1
  from setuptools import setup, find_packages
2
2
 
3
- VERSION = '2.3.0'
3
+ VERSION = '2.4.0'
4
4
 
5
5
 
6
6
  # Setting up
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes