viff

changeset 1057:8bb853b24714

Renamed BasicRuntime to Runtime. This should actually have been when we renamed Runtime to PassiveRuntime.
author Martin Geisler <mg@daimi.au.dk>
date Tue, 16 Dec 2008 13:21:18 +0100
parents 79c3110de9b5
children 806148d6146f
files apps/benchmark.py apps/divide.py apps/multiply.py apps/sum.py doc/runtime.txt viff/paillier.py viff/passive.py viff/runtime.py
diffstat 8 files changed, 20 insertions(+), 20 deletions(-) [+]
line diff
     1.1 --- a/apps/benchmark.py	Thu Dec 11 13:55:58 2008 +0100
     1.2 +++ b/apps/benchmark.py	Tue Dec 16 13:21:18 2008 +0100
     1.3 @@ -63,7 +63,7 @@
     1.4  from twisted.internet import reactor
     1.5  
     1.6  from viff.field import GF, GF256, FakeGF
     1.7 -from viff.runtime import BasicRuntime, create_runtime, gather_shares, \
     1.8 +from viff.runtime import Runtime, create_runtime, gather_shares, \
     1.9      make_runtime_class
    1.10  from viff.passive import PassiveRuntime
    1.11  from viff.active import BasicActiveRuntime, \
    1.12 @@ -126,7 +126,7 @@
    1.13                      operation=operations[0], parallel=True, fake=False)
    1.14  
    1.15  # Add standard VIFF options.
    1.16 -BasicRuntime.add_options(parser)
    1.17 +Runtime.add_options(parser)
    1.18  
    1.19  (options, args) = parser.parse_args()
    1.20  
     2.1 --- a/apps/divide.py	Thu Dec 11 13:55:58 2008 +0100
     2.2 +++ b/apps/divide.py	Tue Dec 16 13:21:18 2008 +0100
     2.3 @@ -35,7 +35,7 @@
     2.4  from twisted.internet import reactor
     2.5  
     2.6  from viff.field import GF
     2.7 -from viff.runtime import BasicRuntime, create_runtime, make_runtime_class
     2.8 +from viff.runtime import Runtime, create_runtime, make_runtime_class
     2.9  from viff.comparison import ComparisonToft07Mixin
    2.10  from viff.config import load_config
    2.11  from viff.util import find_prime, dprint
    2.12 @@ -82,7 +82,7 @@
    2.13  
    2.14      parser.set_defaults(modulus=2**65)
    2.15  
    2.16 -    BasicRuntime.add_options(parser)
    2.17 +    Runtime.add_options(parser)
    2.18  
    2.19      options, args = parser.parse_args()
    2.20      if len(args)==2:
     3.1 --- a/apps/multiply.py	Thu Dec 11 13:55:58 2008 +0100
     3.2 +++ b/apps/multiply.py	Tue Dec 16 13:21:18 2008 +0100
     3.3 @@ -21,11 +21,11 @@
     3.4  from twisted.internet import reactor
     3.5  
     3.6  from viff.field import GF
     3.7 -from viff.runtime import create_runtime, BasicRuntime
     3.8 +from viff.runtime import create_runtime, Runtime
     3.9  from viff.config import load_config
    3.10  
    3.11  parser = OptionParser()
    3.12 -BasicRuntime.add_options(parser)
    3.13 +Runtime.add_options(parser)
    3.14  (options, args) = parser.parse_args()
    3.15  
    3.16  Zp = GF(1031)
     4.1 --- a/apps/sum.py	Thu Dec 11 13:55:58 2008 +0100
     4.2 +++ b/apps/sum.py	Tue Dec 16 13:21:18 2008 +0100
     4.3 @@ -21,11 +21,11 @@
     4.4  from twisted.internet import reactor
     4.5  
     4.6  from viff.field import GF
     4.7 -from viff.runtime import create_runtime, BasicRuntime
     4.8 +from viff.runtime import create_runtime, Runtime
     4.9  from viff.config import load_config
    4.10  
    4.11  parser = OptionParser()
    4.12 -BasicRuntime.add_options(parser)
    4.13 +Runtime.add_options(parser)
    4.14  (options, args) = parser.parse_args()
    4.15  
    4.16  Zp = GF(1031)
     5.1 --- a/doc/runtime.txt	Thu Dec 11 13:55:58 2008 +0100
     5.2 +++ b/doc/runtime.txt	Tue Dec 16 13:21:18 2008 +0100
     5.3 @@ -29,20 +29,20 @@
     5.4  
     5.5     .. autofunction:: create_runtime
     5.6  
     5.7 -   .. autoclass:: BasicRuntime
     5.8 +   .. autoclass:: Runtime
     5.9        :members:
    5.10  
    5.11 -      .. attribute:: BasicRuntime.id
    5.12 +      .. attribute:: Runtime.id
    5.13  
    5.14           Player ID. This is an integer in the range 1--*n* for *n*
    5.15           players.
    5.16  
    5.17 -      .. attribute:: BasicRuntime.threshold
    5.18 +      .. attribute:: Runtime.threshold
    5.19  
    5.20           Default threshold used by :meth:`Runtime.shamir_share`,
    5.21           :meth:`Runtime.open`, and others.
    5.22  
    5.23 -      .. attribute:: BasicRuntime.program_counter
    5.24 +      .. attribute:: Runtime.program_counter
    5.25  
    5.26           Whenever a share is sent over the network, it must be
    5.27           uniquely identified so that the receiving player known what
     6.1 --- a/viff/paillier.py	Thu Dec 11 13:55:58 2008 +0100
     6.2 +++ b/viff/paillier.py	Tue Dec 16 13:21:18 2008 +0100
     6.3 @@ -27,7 +27,7 @@
     6.4  from twisted.internet.defer import Deferred, gatherResults
     6.5  import gmpy
     6.6  
     6.7 -from viff.runtime import BasicRuntime, increment_pc, Share, gather_shares
     6.8 +from viff.runtime import Runtime, increment_pc, Share, gather_shares
     6.9  from viff.util import rand, find_random_prime
    6.10  
    6.11  def L(u, n):
    6.12 @@ -64,11 +64,11 @@
    6.13      return (numer*gmpy.invert(denom, n)) % n
    6.14  
    6.15  
    6.16 -class PaillierRuntime(BasicRuntime):
    6.17 +class PaillierRuntime(Runtime):
    6.18      """Two-player runtime based on the Paillier crypto system."""
    6.19  
    6.20      def add_player(self, player, protocol):
    6.21 -        BasicRuntime.add_player(self, player, protocol)
    6.22 +        Runtime.add_player(self, player, protocol)
    6.23          if player.id == self.id:
    6.24              self.player = player
    6.25          else:
     7.1 --- a/viff/passive.py	Thu Dec 11 13:55:58 2008 +0100
     7.2 +++ b/viff/passive.py	Tue Dec 16 13:21:18 2008 +0100
     7.3 @@ -20,13 +20,13 @@
     7.4  """Passively secure VIFF runtime."""
     7.5  
     7.6  from viff import shamir
     7.7 -from viff.runtime import BasicRuntime, increment_pc, Share, ShareList, gather_shares
     7.8 +from viff.runtime import Runtime, increment_pc, Share, ShareList, gather_shares
     7.9  from viff.prss import prss, prss_lsb, prss_zero
    7.10  from viff.field import GF256, FieldElement
    7.11  from viff.util import rand, profile
    7.12  
    7.13  
    7.14 -class PassiveRuntime(BasicRuntime):
    7.15 +class PassiveRuntime(Runtime):
    7.16      """The VIFF runtime.
    7.17  
    7.18      The runtime is used for sharing values (:meth:`shamir_share` or
    7.19 @@ -47,7 +47,7 @@
    7.20  
    7.21      def __init__(self, player, threshold, options=None):
    7.22          """Initialize runtime."""
    7.23 -        BasicRuntime.__init__(self, player, threshold, options)
    7.24 +        Runtime.__init__(self, player, threshold, options)
    7.25  
    7.26      @increment_pc
    7.27      def open(self, share, receivers=None, threshold=None):
     8.1 --- a/viff/runtime.py	Thu Dec 11 13:55:58 2008 +0100
     8.2 +++ b/viff/runtime.py	Tue Dec 16 13:21:18 2008 +0100
     8.3 @@ -375,7 +375,7 @@
     8.4  
     8.5      The decorated method will be replaced with a proxy method which
     8.6      first tries to get the data needed from
     8.7 -    :attr:`BasicRuntime._pool`, and if that fails it falls back to the
     8.8 +    :attr:`Runtime._pool`, and if that fails it falls back to the
     8.9      original method.
    8.10  
    8.11      The *generator* method is only used to record where the data
    8.12 @@ -401,7 +401,7 @@
    8.13      return preprocess_decorator
    8.14  
    8.15  
    8.16 -class BasicRuntime:
    8.17 +class Runtime:
    8.18      """Basic VIFF runtime with no crypto.
    8.19  
    8.20      This runtime contains only the most basic operations needed such