Mercurial > 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 wrap: on
line diff
--- a/apps/benchmark.py Thu Dec 11 13:55:58 2008 +0100 +++ b/apps/benchmark.py Tue Dec 16 13:21:18 2008 +0100 @@ -63,7 +63,7 @@ from twisted.internet import reactor from viff.field import GF, GF256, FakeGF -from viff.runtime import BasicRuntime, create_runtime, gather_shares, \ +from viff.runtime import Runtime, create_runtime, gather_shares, \ make_runtime_class from viff.passive import PassiveRuntime from viff.active import BasicActiveRuntime, \ @@ -126,7 +126,7 @@ operation=operations[0], parallel=True, fake=False) # Add standard VIFF options. -BasicRuntime.add_options(parser) +Runtime.add_options(parser) (options, args) = parser.parse_args()
--- a/apps/divide.py Thu Dec 11 13:55:58 2008 +0100 +++ b/apps/divide.py Tue Dec 16 13:21:18 2008 +0100 @@ -35,7 +35,7 @@ from twisted.internet import reactor from viff.field import GF -from viff.runtime import BasicRuntime, create_runtime, make_runtime_class +from viff.runtime import Runtime, create_runtime, make_runtime_class from viff.comparison import ComparisonToft07Mixin from viff.config import load_config from viff.util import find_prime, dprint @@ -82,7 +82,7 @@ parser.set_defaults(modulus=2**65) - BasicRuntime.add_options(parser) + Runtime.add_options(parser) options, args = parser.parse_args() if len(args)==2:
--- a/apps/multiply.py Thu Dec 11 13:55:58 2008 +0100 +++ b/apps/multiply.py Tue Dec 16 13:21:18 2008 +0100 @@ -21,11 +21,11 @@ from twisted.internet import reactor from viff.field import GF -from viff.runtime import create_runtime, BasicRuntime +from viff.runtime import create_runtime, Runtime from viff.config import load_config parser = OptionParser() -BasicRuntime.add_options(parser) +Runtime.add_options(parser) (options, args) = parser.parse_args() Zp = GF(1031)
--- a/apps/sum.py Thu Dec 11 13:55:58 2008 +0100 +++ b/apps/sum.py Tue Dec 16 13:21:18 2008 +0100 @@ -21,11 +21,11 @@ from twisted.internet import reactor from viff.field import GF -from viff.runtime import create_runtime, BasicRuntime +from viff.runtime import create_runtime, Runtime from viff.config import load_config parser = OptionParser() -BasicRuntime.add_options(parser) +Runtime.add_options(parser) (options, args) = parser.parse_args() Zp = GF(1031)
--- a/doc/runtime.txt Thu Dec 11 13:55:58 2008 +0100 +++ b/doc/runtime.txt Tue Dec 16 13:21:18 2008 +0100 @@ -29,20 +29,20 @@ .. autofunction:: create_runtime - .. autoclass:: BasicRuntime + .. autoclass:: Runtime :members: - .. attribute:: BasicRuntime.id + .. attribute:: Runtime.id Player ID. This is an integer in the range 1--*n* for *n* players. - .. attribute:: BasicRuntime.threshold + .. attribute:: Runtime.threshold Default threshold used by :meth:`Runtime.shamir_share`, :meth:`Runtime.open`, and others. - .. attribute:: BasicRuntime.program_counter + .. attribute:: Runtime.program_counter Whenever a share is sent over the network, it must be uniquely identified so that the receiving player known what
--- a/viff/paillier.py Thu Dec 11 13:55:58 2008 +0100 +++ b/viff/paillier.py Tue Dec 16 13:21:18 2008 +0100 @@ -27,7 +27,7 @@ from twisted.internet.defer import Deferred, gatherResults import gmpy -from viff.runtime import BasicRuntime, increment_pc, Share, gather_shares +from viff.runtime import Runtime, increment_pc, Share, gather_shares from viff.util import rand, find_random_prime def L(u, n): @@ -64,11 +64,11 @@ return (numer*gmpy.invert(denom, n)) % n -class PaillierRuntime(BasicRuntime): +class PaillierRuntime(Runtime): """Two-player runtime based on the Paillier crypto system.""" def add_player(self, player, protocol): - BasicRuntime.add_player(self, player, protocol) + Runtime.add_player(self, player, protocol) if player.id == self.id: self.player = player else:
--- a/viff/passive.py Thu Dec 11 13:55:58 2008 +0100 +++ b/viff/passive.py Tue Dec 16 13:21:18 2008 +0100 @@ -20,13 +20,13 @@ """Passively secure VIFF runtime.""" from viff import shamir -from viff.runtime import BasicRuntime, increment_pc, Share, ShareList, gather_shares +from viff.runtime import Runtime, increment_pc, Share, ShareList, gather_shares from viff.prss import prss, prss_lsb, prss_zero from viff.field import GF256, FieldElement from viff.util import rand, profile -class PassiveRuntime(BasicRuntime): +class PassiveRuntime(Runtime): """The VIFF runtime. The runtime is used for sharing values (:meth:`shamir_share` or @@ -47,7 +47,7 @@ def __init__(self, player, threshold, options=None): """Initialize runtime.""" - BasicRuntime.__init__(self, player, threshold, options) + Runtime.__init__(self, player, threshold, options) @increment_pc def open(self, share, receivers=None, threshold=None):
--- a/viff/runtime.py Thu Dec 11 13:55:58 2008 +0100 +++ b/viff/runtime.py Tue Dec 16 13:21:18 2008 +0100 @@ -375,7 +375,7 @@ The decorated method will be replaced with a proxy method which first tries to get the data needed from - :attr:`BasicRuntime._pool`, and if that fails it falls back to the + :attr:`Runtime._pool`, and if that fails it falls back to the original method. The *generator* method is only used to record where the data @@ -401,7 +401,7 @@ return preprocess_decorator -class BasicRuntime: +class Runtime: """Basic VIFF runtime with no crypto. This runtime contains only the most basic operations needed such