/rev/8a5eb6550111 changeset: 1219:8a5eb6550111 user: Janus Dam Nielsen <[email protected]> date: Tue Oct 06 10:04:36 2009 +0200 summary: Constants used in communication is refactored to a new file.
diffstat: viff/active.py | 2 +- viff/constants.py | 27 +++++++++++++++++++++++++++ viff/paillier.py | 2 +- viff/runtime.py | 8 +------- viff/test/test_runtime.py | 3 ++- 5 files changed, 32 insertions(+), 10 deletions(-) diffs (93 lines): diff -r c43b0e520aba -r 8a5eb6550111 viff/active.py --- a/viff/active.py Tue Oct 06 10:04:20 2009 +0200 +++ b/viff/active.py Tue Oct 06 10:04:36 2009 +0200 @@ -28,7 +28,7 @@ from viff.matrix import Matrix, hyper from viff.passive import PassiveRuntime from viff.runtime import Share, preprocess, gather_shares -from viff.runtime import ECHO, READY, SEND +from viff.constants import ECHO, READY, SEND class BrachaBroadcastMixin: diff -r c43b0e520aba -r 8a5eb6550111 viff/constants.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/viff/constants.py Tue Oct 06 10:04:36 2009 +0200 @@ -0,0 +1,27 @@ +# -*- coding: utf-8 -*- +# +# Copyright 2009 VIFF Development Team. +# +# This file is part of VIFF, the Virtual Ideal Functionality Framework. +# +# VIFF is free software: you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License (LGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# VIFF is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General +# Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with VIFF. If not, see <http://www.gnu.org/licenses/>. + +__docformat__ = "restructuredtext" + +# Constants used for communication. +SHARE = 0 +ECHO = 1 +READY = 2 +SEND = 3 +PAILLIER = 4 diff -r c43b0e520aba -r 8a5eb6550111 viff/paillier.py --- a/viff/paillier.py Tue Oct 06 10:04:20 2009 +0200 +++ b/viff/paillier.py Tue Oct 06 10:04:36 2009 +0200 @@ -28,7 +28,7 @@ import gmpy from viff.runtime import Runtime, Share, gather_shares -from viff.runtime import PAILLIER +from viff.constants import PAILLIER from viff.util import rand, find_random_prime def L(u, n): diff -r c43b0e520aba -r 8a5eb6550111 viff/runtime.py --- a/viff/runtime.py Tue Oct 06 10:04:20 2009 +0200 +++ b/viff/runtime.py Tue Oct 06 10:04:36 2009 +0200 @@ -41,6 +41,7 @@ from viff.field import GF256, FieldElement from viff.util import wrapper, rand, deep_wait, track_memory_usage, begin, end +from viff.constants import SHARE import viff.reactor from twisted.internet import reactor @@ -51,13 +52,6 @@ from twisted.internet.protocol import ReconnectingClientFactory, ServerFactory from twisted.protocols.basic import Int16StringReceiver -# Constants used by ShareExchanger. -SHARE = 0 -ECHO = 1 -READY = 2 -SEND = 3 -PAILLIER = 4 - class Share(Deferred): """A shared number. diff -r c43b0e520aba -r 8a5eb6550111 viff/test/test_runtime.py --- a/viff/test/test_runtime.py Tue Oct 06 10:04:20 2009 +0200 +++ b/viff/test/test_runtime.py Tue Oct 06 10:04:36 2009 +0200 @@ -30,7 +30,8 @@ from twisted.internet.defer import gatherResults, Deferred, DeferredList from viff.field import GF256 -from viff.runtime import Share, SHARE +from viff.runtime import Share +from viff.constants import SHARE from viff.comparison import Toft05Runtime from viff.test.util import RuntimeTestCase, BinaryOperatorTestCase, protocol _______________________________________________ viff-commits mailing list [email protected] http://lists.viff.dk/listinfo.cgi/viff-commits-viff.dk
