Using the Overloaded Python Operators#
The main building block for computation using the Encrypted Operator Computation (EOC) method is the overloading of Python functions. In other words, USEncrypt® functions are used to overload the traditional Python syntax when operating on encrypted objects.
For example, adding two encrypted values can be easily done as follows:
>> import usencrypt as ue
>>> x = ue.encrypt(5)
>>> y = ue.encrypt(10)
>>> z = x + y
>>> ue.decrypt(z)
15
The following is a comprehensive list of overloaded operators in USEncrypt®:
Operation |
Symbol |
Use |
---|---|---|
Addition |
|
|
Subtraction |
|
|
Multiplication |
|
|
Division |
|
|
Negation |
|
|
Equal To |
|
|
Not Equal To |
|
|
Greater Than |
|
|
Less Than |
|
|
Greater Than or Equal To |
|
|
Less Than or Equal To |
|
|
AND |
|
|
OR |
|
|
XOR |
|
|