Пример #1
0
 def op(left, right, void=None):
     goal, src, src_index, _ = left
     l, secret_i, index, i = right
     high, low = comp_binary(l, goal)
     replace = high * (1 - low) * (1 - buckets[i].is_empty())
     goal = if_else(replace, bit_compose(l), \
                    bit_compose(goal)).bit_decompose(len(goal))
     src = if_else(replace, secret_i, src)
     src_index = if_else(replace, index, src_index)
     return goal, src, src_index, i
Пример #2
0
 def op(left, right, void=None):
     goal, src, src_index, _ = left
     l, secret_i, index, i = right
     high, low = comp_binary(l, goal)
     replace = high * (1 - low) * (1 - buckets[i].is_empty())
     goal = if_else(replace, bit_compose(l), \
                    bit_compose(goal)).bit_decompose(len(goal))
     src = if_else(replace, secret_i, src)
     src_index = if_else(replace, index, src_index)
     return goal, src, src_index, i
Пример #3
0
 def evict_rounds(self):
     get_path = lambda x: bit_compose(reversed(x.bit_decompose(self.D)))
     paths = [get_path(2 * self.t + i) for i in range(2)]
     for path in paths:
         for _ in self.evict_once(path):
             yield
     self.t.iadd(1)
Пример #4
0
 def evict_rounds(self):
     get_path = lambda x: bit_compose(reversed(x.bit_decompose(self.D)))
     paths = [get_path(2 * self.t + i) for i in range(2)]
     for path in paths:
         for _ in self.evict_once(path):
             yield
     self.t.iadd(1)
Пример #5
0
 def evict_deterministic(self):
     get_path = lambda x: bit_compose(reversed(x.bit_decompose(self.D)))
     paths = [get_path(2 * self.t + i) for i in range(2)]
     deepests = [self.prepare_deepest(path) for path in paths]
     targets = [self.prepare_target(path, deepest) for path,deepest in zip(paths,deepests)]
     evictors = [self.evict_once_fast(path, target) for path,target in zip(paths, targets)]
     for evictor in evictors:
         next(evictor)
         Program.prog.curr_tape.start_new_basicblock(name='evictor-%d' % self.size)
     towrites = [next(evictor) for evictor in evictors]
     for path,towrite in zip(paths, towrites):
         self.add_evicted(path, towrite)
     self.t.iadd(1)