viff

changeset 743:57ce422feb55

Converted docstrings in viff.comparison to Sphinx format.
author Martin Geisler <mg@daimi.au.dk>
date Wed, 30 Apr 2008 10:05:34 +0200
parents 88d4c3f9cee1
children e0f9090cf95c
files viff/comparison.py
diffstat 1 files changed, 16 insertions(+), 16 deletions(-) [+]
line diff
     1.1 --- a/viff/comparison.py	Tue Apr 29 09:31:34 2008 +0200
     1.2 +++ b/viff/comparison.py	Wed Apr 30 10:05:34 2008 +0200
     1.3 @@ -15,12 +15,12 @@
     1.4  # You should have received a copy of the GNU Lesser General Public
     1.5  # License along with VIFF. If not, see <http://www.gnu.org/licenses/>.
     1.6  
     1.7 -"""Comparison protocols.
     1.8 +"""Comparison protocols. The mixin classes defined here provide a
     1.9 +:meth:`greater_than_equal` method to the :class:`Runtime
    1.10 +<viff.runtime.Runtime>` they are mixed with.
    1.11 +"""
    1.12  
    1.13 -The mixin classes defined here provide a C{greater_than_equal} method
    1.14 -to the L{Runtime} they are mixed with.
    1.15 -
    1.16 -"""
    1.17 +__docformat__ = "restructuredtext"
    1.18  
    1.19  import math
    1.20  
    1.21 @@ -54,7 +54,7 @@
    1.22  
    1.23      @increment_pc
    1.24      def greater_than_equal(self, share_a, share_b):
    1.25 -        """Compute share_a >= share_b.
    1.26 +        """Compute ``share_a >= share_b``.
    1.27  
    1.28          Both arguments must be from the field given. The result is a
    1.29          GF256 share.
    1.30 @@ -140,16 +140,16 @@
    1.31  
    1.32  
    1.33  class Toft05Runtime(ComparisonToft05Mixin, Runtime):
    1.34 -    """Default mix of L{ComparisonToft05Mixin} and L{Runtime}."""
    1.35 +    """Default mix of :class:`ComparisonToft05Mixin` and
    1.36 +    :class:`Runtime <viff.runtime.Runtime>`."""
    1.37      pass
    1.38  
    1.39  
    1.40  class ComparisonToft07Mixin:
    1.41  
    1.42 -    """Efficient comparison by Tomas Toft 2007.
    1.43 -
    1.44 -    This mixin provides a C{greater_than} method which can compare Zp
    1.45 -    field elements and gives a secret result shared over Zp.
    1.46 +    """Efficient comparison by Tomas Toft 2007. This mixin provides a
    1.47 +    :meth:`greater_than_equal` method which can compare Zp field
    1.48 +    elements and gives a secret result shared over Zp.
    1.49      """
    1.50  
    1.51      @increment_pc
    1.52 @@ -235,9 +235,7 @@
    1.53  
    1.54      @increment_pc
    1.55      def greater_than_equal_online(self, share_a, share_b, preproc, field):
    1.56 -        """Compute share_a >= share_b.
    1.57 -        Result is shared.
    1.58 -        """
    1.59 +        """Compute ``share_a >= share_b``. Result is shared."""
    1.60          # increment l as a, b are increased
    1.61          l = self.options.bit_length + 1
    1.62          # a = 2a+1; b= 2b // ensures inputs not equal
    1.63 @@ -310,7 +308,7 @@
    1.64  
    1.65      @increment_pc
    1.66      def greater_than_equal(self, share_a, share_b):
    1.67 -        """Compute share_a >= share_b.
    1.68 +        """Compute ``share_a >= share_b``.
    1.69  
    1.70          Both arguments must be of type field. The result is a
    1.71          field share.
    1.72 @@ -332,5 +330,7 @@
    1.73  
    1.74  
    1.75  class Toft07Runtime(ComparisonToft07Mixin, Runtime):
    1.76 -    """Default mix of L{ComparisonToft07Mixin} and L{Runtime}."""
    1.77 +    """Default mix of :class:`ComparisonToft07Mixin` and
    1.78 +    :class:`Runtime <viff.runtime.Runtime>`.
    1.79 +    """
    1.80      pass