INNER CODE UNIT · Python

__init__

lschoe/mpyc · demos/PrefixOrExplained.py:92

    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:
            # b is a public value
            c.or_depth = self.or_depth
        return c

    __ror__ = __or__

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…