changeset 992:13a883981248

Profile comparison protocols.
author Martin Geisler <mg@daimi.au.dk>
date Wed, 01 Oct 2008 14:09:26 +0200
parents afe30d97ec32
children ed6a1c88de29
files viff/comparison.py
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/viff/comparison.py	Wed Oct 01 14:05:20 2008 +0200
+++ b/viff/comparison.py	Wed Oct 01 14:09:26 2008 +0200
@@ -24,7 +24,7 @@
 
 import math
 
-from viff.util import rand
+from viff.util import rand, profile
 from viff.runtime import Runtime, Share, gather_shares, increment_pc
 from viff.active import ActiveRuntime
 from viff.field import GF256, FieldElement
@@ -52,6 +52,7 @@
         tmp.field = dst_field
         return reduce(self.xor, dst_shares, tmp)
 
+    @profile
     @increment_pc
     def greater_than_equal(self, share_a, share_b):
         """Compute ``share_a >= share_b``.
@@ -184,6 +185,7 @@
         full_mask = reduce(self.add, dst_shares)
         return tmp - full_mask
 
+    @profile
     @increment_pc
     def greater_than_equal_preproc(self, field, smallField=None):
         """Preprocessing for :meth:`greater_than_equal`."""
@@ -238,6 +240,7 @@
         # Preprocessing done
         ##################################################
 
+    @profile
     @increment_pc
     def greater_than_equal_online(self, share_a, share_b, preproc, field):
         """Compute ``share_a >= share_b``. Result is secret shared."""