viff

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 diff
     1.1 --- a/viff/comparison.py	Wed Oct 01 14:05:20 2008 +0200
     1.2 +++ b/viff/comparison.py	Wed Oct 01 14:09:26 2008 +0200
     1.3 @@ -24,7 +24,7 @@
     1.4  
     1.5  import math
     1.6  
     1.7 -from viff.util import rand
     1.8 +from viff.util import rand, profile
     1.9  from viff.runtime import Runtime, Share, gather_shares, increment_pc
    1.10  from viff.active import ActiveRuntime
    1.11  from viff.field import GF256, FieldElement
    1.12 @@ -52,6 +52,7 @@
    1.13          tmp.field = dst_field
    1.14          return reduce(self.xor, dst_shares, tmp)
    1.15  
    1.16 +    @profile
    1.17      @increment_pc
    1.18      def greater_than_equal(self, share_a, share_b):
    1.19          """Compute ``share_a >= share_b``.
    1.20 @@ -184,6 +185,7 @@
    1.21          full_mask = reduce(self.add, dst_shares)
    1.22          return tmp - full_mask
    1.23  
    1.24 +    @profile
    1.25      @increment_pc
    1.26      def greater_than_equal_preproc(self, field, smallField=None):
    1.27          """Preprocessing for :meth:`greater_than_equal`."""
    1.28 @@ -238,6 +240,7 @@
    1.29          # Preprocessing done
    1.30          ##################################################
    1.31  
    1.32 +    @profile
    1.33      @increment_pc
    1.34      def greater_than_equal_online(self, share_a, share_b, preproc, field):
    1.35          """Compute ``share_a >= share_b``. Result is secret shared."""