VIFF allows you to write a program which will interact with other programs in order to execute a joint computation. This is called a multi-party computation, MPC for short.
The programs will implement what we call a virtual ideal functionality (IF). The idea is that the behavior of the programs should be indistinguishable from the behavior of programs interacting with a so-called ideal functionality. An ideal functionality is a player that cannot be corrupted, also known as a trusted third party (TTP).
Interacting with an IF is easy: all players give their inputs to the IF, which computes the results. The results are then distributed to the correct players. The inputs and the results are sent over secure channels, and since the IF cannot be corrupted, this ideal protocol must be secure.
In the real world there is no IF, but VIFF allows you to implement a virtual ideal functionality. The behavior of a bunch of programs using VIFF is indistinguishable from program running in the ideal world. It is indistinguishable in the sense that everything that can happen in the real world protocol could happen in the ideal world too. Since no attacks can occur in the ideal world, no attacks can occur in the real world as well. We call this a secure multi-party computation (MPC).
Please note that like all cryptographic systems, VIFF is only secure as long as certain assumptions are fulfilled. These assumptions include:
The precise assumptions for each protocol will eventually be included in the documentation, but this has not yet been done in all cases.
VIFF consists of several modules. The viff.runtime module contains the Runtime and Share classes, in which the main functionality is implemented. The viff.field module contains implementations of finite fields — these are the values inside the shares. Other modules provide support functions.
The basic functionality in VIFF is implemented in the Runtime class. This class offers methods to do simple network communication. The PassiveRuntime class implements the BGW protocol and offers methods for addition, multiplication, etc. These methods operate on Share instances.
Shares hold either GFElement or GF256 elements and are created from the shamir_share() or prss_share() Runtime methods. Shares overload the standard arithmetic operators, so you can write a + b - c * d with four shares, and it will be translated correctly into the appropriate method calls on the Runtime associated with the shares.
A field element contain the concrete value on which we do calculations. This is just a normal Python (long) integer. The value is wrapped in an object that will keep track of doing modulo reductions as appropriate.
So in a nutshell, VIFF has these layers: