# HG changeset patch
# User Sigurd Meldgaard <[EMAIL PROTECTED]>
# Date 1221574088 -7200
# Node ID 0ae0b7196ac880b3b0cfaaf6202650dbd7a9b1fd
# Parent  635a8d6ac335e6282f4e555e0f624195299d9297
Added support for equality to the runtime

diff -r 635a8d6ac335 -r 0ae0b7196ac8 viff/runtime.py
--- a/viff/runtime.py   Sun Aug 24 23:26:45 2008 +0200
+++ b/viff/runtime.py   Tue Sep 16 16:08:08 2008 +0200
@@ -131,6 +131,21 @@
         """Greater-than or equal comparison."""
         # self >= other
         return self.runtime.greater_than_equal(self, other)
+
+    def __eq__(self, other):
+        """
+        Equality testing
+        returns a share of 1 if self == other mod p
+        0 otherwise
+        """
+        return self.runtime.equal(self,other)
+
+    def __neq__(self, other):
+        """
+        Negated equality testing
+        """
+        return 1 - self.runtime.equal(self,other)
+
 
     def clone(self):
         """Clone a share.
_______________________________________________
viff-patches mailing list
[email protected]
http://lists.viff.dk/listinfo.cgi/viff-patches-viff.dk

Reply via email to