INNER CODE UNIT · Python
secint
lschoe/mpyc · demos/PrefixOrExplained.py:86
class secint(secint):
__slots__ = 'or_depth'
or_complexity = 0
def __init__(self, value=None):
self.or_depth = 0
super().__init__(value)
def __or__(self, b):
c = super().__or__(b)
# self is a secure (secret-shared) integer
if isinstance(b, secint):
# b is a secure (secret-shared) integer as well
c.or_depth = max(self.or_depth, b.or_depth) + 1 # one round of communication for secure or
secint.or_complexity += 1
else: