Home | Trees | Indices | Help |
|
---|
|
The VIFF runtime.
The runtime is used for sharing values (:meth:`shamir_share` or :meth:`prss_share`) into :class:`Share` object and opening such shares (:meth:`open`) again. Calculations on shares is normally done through overloaded arithmetic operations, but it is also possible to call :meth:`add`, :meth:`mul`, etc. directly if one prefers.
Each player in the protocol uses a :class:`Runtime` object. To create an instance and connect it correctly with the other players, please use the :func:`create_runtime` function instead of instantiating a Runtime directly. The :func:`create_runtime` function will take care of setting up network connections and return a :class:`Deferred` which triggers with the :class:`Runtime` object when it is ready.
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
Inherited from Inherited from |
|
|||
Inherited from |
|
|||
Inherited from Inherited from |
|
Initialize runtime.
|
Open share to receivers (defaults to all players). Returns a Share to players with IDs in receivers and None to the remaining players.
|
Open a secret sharing. The *receivers* are the players that will eventually obtain the opened result. The default is to let everybody know the result. By default the :attr:`threshold` + 1 shares are reconstructed, but *threshold* can be used to override this. Communication cost: every player sends one share to each receiving player. |
Addition of shares. Communication cost: none.
|
Subtraction of shares. Communication cost: none. |
Linear combination of shares. Communication cost: none. Saves the construction of unnecessary shares compared to using add() and mul().
|
Multiplication of shares. Communication cost: 1 Shamir sharing.
|
Create unique key for PRSS. This increments the program counter and returns it as a tuple. Each straight-line program (typically a callback attached to some :class:`Deferred`) is executed in a context with unique starting program counter. This ensures that consequetive calls to PRSS-related methods will use unique program counters. |
Creates pseudo-random secret sharings. This protocol creates a secret sharing for each player in the subset of players specified in *inputters*. Each inputter provides an integer. The result is a list of shares, one for each inputter. The protocol uses the pseudo-random secret sharing technique described in the paper "Share Conversion, Pseudorandom Secret-Sharing and Applications to Secure Computation" by Ronald Cramer, Ivan Damgård, and Yuval Ishai in Proc. of TCC 2005, LNCS 3378. `Download <http://www.cs.technion.ac.il/~yuvali/pubs/CDI05.ps>`__ Communication cost: Each inputter does one broadcast. |
Generate shares of a uniformly random element from the field given. If binary is True, a 0/1 element is generated. No player learns the value of the element. Communication cost: none if binary=False, 1 open otherwise. |
Does the same as calling *quantity* times :meth:`prss_share_random`, but with less calls to the PRF. Sampling of a binary element is only possible if the field is :class:`GF256`. Communication cost: none. |
Generate *quantity* shares of the zero element from the field given. Communication cost: none. |
Make *quantity* double-sharings using PRSS. The pair of shares will have degree t and 2t where t is the default threshold for the runtime. |
Share a random bit over *field* and GF256. The protocol is described in "Efficient Conversion of Secret-shared Values Between Different Fields" by Ivan Damgård and Rune Thorbek available as `Cryptology ePrint Archive, Report 2008/221 <http://eprint.iacr.org/2008/221>`__. |
Generate a random secret share in GF256 and returns [*share*, *share*^2, *share*^4, ..., *share*^(i^max)].
|
Does *quantity* times the same as :meth:`prss_powerchain`. Used for preprocessing. |
Input *number* to the computation. The input is shared using the :meth:`shamir_share` method.
|
Secret share *number* over *field* using Shamir's method. The number is shared using polynomial of degree *threshold* (defaults to :attr:`threshold`). Returns a list of shares unless there is only one inputter in which case the share is returned directly. In code it is used like this: a, b, c = runtime.shamir_share([1, 2, 3], Zp, x) where ``Zp`` is a field and ``x`` is a Python integer holding the input of each player (three inputs in total). If only a subset of the players provide input it looks like this: if runtime.id == 1: a = runtime.shamir_share([1], Zp, x) else: a = runtime.shamir_share([1], Zp) Instead of branching when calling :meth:`shamir_share`, one can give ``None`` as input: if runtime.id == 1: x = int(raw_input("Input x: ")) else: x = None a = runtime.shamir_share([1], Zp, x) which might be practical in some cases. Communication cost: n elements transmitted. |
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Mon Oct 19 16:43:44 2009 | http://epydoc.sourceforge.net |